New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

Apache works, but PHP will not


Post Reply New Thread Subscribe

 
Thread Tools
Mac4Work

 
Member Since: Dec 15, 2008
Posts: 3
Mac4Work is on a distinguished road

Mac4Work is offline
I am working on getting a client version of Apache and PHP working on my MacBook Pro. I installed Leopard on it sometime ago (10.5.5 as of today).

I am trying to set up Apache and php. So far I have the Apache server working fine for the system directory and my Sites directory.

I downloaded php from Marc Liyanage - Software - Mac OS X Packages - PHP as it seemed like Adobe wanted me to (I will be using Dreamweaver CS4 for development). The install of the download seemed to work fine....but...

..when I run the file called timetest.php (that has the following php code):

<p>This page was created at
<b><?php echo date("h:i:s a", time()); ?></b> on the computer running PHP.</p>

I get the following output in Firefox..(when it is supposed to print out the current time and date)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>
&lt;p&gt;This page was created at<br />
&lt;b&gt;&lt;?php echo date(&quot;h:i:s a&quot;, time()); ?&gt;&lt;/b&gt; on the computer running PHP.&lt;/p&gt;
</body>
</html>

I am also aware that I can use the bundled version of php (if I did not hammer it with my download) by taking out the comment on the

#LoadModule php5_module libexec/apache2/libphp5.so

line of the hhtpd.conf file....but I tried that with no better result.

Anybody run across this before? And I would like to solve this problem and don't want to consider MAMP at this time.
QUOTE Thanks
jimd144

 
jimd144's Avatar
 
Member Since: Dec 02, 2008
Location: Sacramento
Posts: 145
jimd144 will become famous soon enough
Mac Specs: MacBook Pro

jimd144 is offline
did you restart apache after taking out the comment?
QUOTE Thanks
Mac4Work

 
Member Since: Dec 15, 2008
Posts: 3
Mac4Work is on a distinguished road

Mac4Work is offline
Hello Jim,

Yes. I have restarted web sharing.

Interestingly, the downloaded version reacts differently than the embedded version. When I take the comment out of the httpd.conf file I get the following output ...which is simply the code being restated in a browser page...weird...

<p>This page was created at
<b><?php echo date("h:i:s a", time()); ?></b> on the computer running PHP.</p>

It's like the code is being generated/read, but not executed. It generates a lot more code as per my original post with the downloaded php. But does not actually run it. As I said earlier, it runs any html correctly.
QUOTE Thanks
jimd144

 
jimd144's Avatar
 
Member Since: Dec 02, 2008
Location: Sacramento
Posts: 145
jimd144 will become famous soon enough
Mac Specs: MacBook Pro

jimd144 is offline
Did you follow this procedure?

PHP: Installation on Mac OS X - Manual


I run it just fine.
You are right, the php is not running, as you are simply getting http returns when php should be interpreting it.
QUOTE Thanks
Mac4Work

 
Member Since: Dec 15, 2008
Posts: 3
Mac4Work is on a distinguished road

Mac4Work is offline
OK Jim...I followed the link you gave me and somehow ended up here...

Enabling PHP in Mac OS X 10.5

I followed these instructions to the letter and now it works. Thanks for getting me down this path!

These instructions are the best and most complete I have seen yet. This David Powers seems to have some interesting books listed on this site....as I will be using Dreamweaver CS4....

Thanks...
QUOTE Thanks
jimd144

 
jimd144's Avatar
 
Member Since: Dec 02, 2008
Location: Sacramento
Posts: 145
jimd144 will become famous soon enough
Mac Specs: MacBook Pro

jimd144 is offline
Cool. Now on to MySQL!
QUOTE Thanks

Post Reply New Thread Subscribe


« iWeb Question | forums on iweb? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
PHP and GD2 falcontook OS X - Development and Darwin 0 09-09-2008 08:46 PM
Getting PHP to work on Leopard s.osullivan OS X - Development and Darwin 3 01-07-2008 01:11 PM
MAMP: PHP can't catch HTTP variables komo Web Design and Hosting 4 06-05-2006 10:39 AM
PHP 4.3.11 to PHP 5 prplxd OS X - Development and Darwin 1 12-04-2005 10:57 AM
Apache + PHP + MySQL Emrys OS X - Development and Darwin 2 11-14-2003 01:30 AM

All times are GMT -4. The time now is 03:54 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?