Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP5 Problem after Snow Leopard Upgrade

Status
Not open for further replies.

peterv12

Technical User
Dec 31, 2008
108
US
I had a PHP 5 installation on my MacBook Pro that ran perfectly in OS X Leopard. After I upgraded to Snow Leopard, however, it looks like the OS can't find PHP. When I click on a link to a php page on my localhost website, I get the source of the php page instead of the rendered page. I'm assuming that the PATH variable was probably changed during the upgrade. Can anyone tell me what the name of the php executable file is and where it might be located? I've searched, but haven't found anything that looks like it might be what I'm looking for. Thanks....
 
it's more likely that the httpd.conf file was overwritten (along with the whole php installation) and hence the files are not being parsed by php.

to re-enable php i would do the following:

1. turn off web sharing
2. load up terminal
3. type the following code

Code:
cd /etc/apache2
sudo nano httpd.conf
[enter password]

look for the line that has the following
Code:
#LoadModule php5_module        libexec/apache2/libphp5.so
and delete the starting # sign. if the line is not present, add it somewhere sensible (at the end of the loadModule commands)

save the file in nano (ctrl-X then follow the prompts)
restart the web sharing and try out a php page.

phpinfo will tell you where your current php.ini is located. typically there is not one set up for new installations.

php.ini should typically be stored in /etc if you look there you should see various php.ini.* files. take the default version (or the one names -previous) and cp it to php.ini. then just in case do this

Code:
sudo chown root:wheel php.ini

if you need to edit php.ini (for example to add the required time/locale information) remember to use sudo to do so
Code:
sudo nano php.ini

nb it is unlikely that you will have a mysql installation if you have done a fresh install of mysql. if you had it before an have just upgraded (which is what you say), mysql will be there but may not be working. let us know if that is the case. there are ways to get it working again (i think) but a reinstall is probably best.

alternativs are MAMP installations such as and XAMPP. of these i prefer MAMP as it is encapsulated in userland. if i want to uninstall or upgrade i just junk the folder and download a new copy for the internet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top