Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > PHP on OS X?

PHP on OS X?
Thread Tools
Mac Enthusiast
Join Date: Nov 2001
Location: Washington, DC 20009
Status: Offline
Reply With Quote
Dec 9, 2002, 10:34 AM
 
I tried installing the new version of PHP on my Powerbook. I went to php.net, followed the links to the needed OS X files, and then followed the installation instructions exactly. When I tried typing in a simple bit of PHP code, however, it did not display. I can view standard HTML pages that are local on my hd in IE, but PHP code does not seem to work.

I'm looking to set my powerbook up as a fully functional local webserver so that I can develop pages and view them locally before uploading them to a remote server. Could someone advise how I would go about setting this up or where I can find information on it.

Thanks.
Just my $.02 :-)
Ti Powerbook 1Ghz w/ Superdrive ......and lovin' it! :)
     
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
Dec 9, 2002, 10:49 AM
 
I'm assuming you went into System Prefs and enabled Web Sharing, but if not there's a good solution. It's been a few months since I installed it on my computer and I struggled through it. A suggested site (linked to the walkthrough you'll want):

http://www.phpmac.com/articles/view....2384850799cacf

That's what took me through the process, good luck. I spent one VERY long night (6 or 7 am) setting it up, but haven't had problems since (was also setting up MySQL though).

Travis
forté web design
     
Dedicated MacNNer
Join Date: Oct 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Dec 9, 2002, 07:26 PM
 
Give me a bit more description on what your problem is.

One of the very first things I do when I test out a PHP install is to make a file called "test.php", and put in just one line here..

< ?php echo("foobars"); ?>
(eliminate the space between the < and the ? above, vbb wouldnt let me put in the complete php code.)

Put that in /Library/WebServer/Documents and then try loading:

http://127.0.0.1/test.php

If it works, you'll get a long page with very verbose information about your PHP install.

If it doesn't work. What happens? Do you get a page and the php code is displayed? If so, the problem is that apache is not correctly passing it off to the PHP engine, and you need to check to see if the correct types are set in your httpd.conf for PHP files.

Otherwise, go in more detail what you see when you try to load the page.

-tim
     
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
Dec 9, 2002, 08:22 PM
 
Originally posted by timster:
Do you get a page and the php code is displayed? If so, the problem is that apache is not correctly passing it off to the PHP engine, and you need to check to see if the correct types are set in your httpd.conf for PHP files.
[/B]
That could be, but it could also mean PHP4 wasn't properly installed.

Travis
forté web design

p.s. My preferred test is using info(); rather than echo();, but they both work just fine.
     
Mac Elite
Join Date: Mar 2001
Location: somewhere in ohio
Status: Offline
Reply With Quote
Dec 9, 2002, 10:12 PM
 
     
milf  (op)
Mac Enthusiast
Join Date: Nov 2001
Location: Washington, DC 20009
Status: Offline
Reply With Quote
Dec 10, 2002, 09:32 AM
 
http://www.entropy.ch/software/macosx/php/
This is what I used to install PHP initially. I'll give it another whirl and update with more specific information the next chance I get. Thanks.
Just my $.02 :-)
Ti Powerbook 1Ghz w/ Superdrive ......and lovin' it! :)
     
Dedicated MacNNer
Join Date: Oct 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Dec 10, 2002, 12:21 PM
 
Whoops! Did i actually write echo()?

I actually meant to say phpinfo(). Duh.
     
   
Thread Tools
Forum Links
Forum 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 On
Top
Privacy Policy
All times are GMT -5. The time now is 01:56 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2