How to activate PHP in Mac OS
Leopard:
$> cd /etc/apache2/
$> sudo pico httpd.conf
[Enter]press [CTRL]+[W]
type: php [Enter]
- # LoadModule php5_module libexec/apache2/libphp5.so
Now remove the hash (#)
press [CTRL]+[O], [Enter]
To exit Pico, press [Ctrl]+[X]
To activate PHP, reboot or enter in terminal:
$> sudo apachectl restart
Tiger:
$> cd /etc/httpd
$> sudo pico httpd.conf
[Enter]press [CTRL]+[W]
type: php [Enter]
- # LoadModule php4_module libexec/httpd/libphp4.so
Now remove the hash (#)
Repeat the same procedure until you find this line:
# AddModule mod_php4.c
And remove the hash (#).
press [CTRL]+[O], [Enter]
To exit Pico, press [Ctrl]+[X]
To activate PHP, reboot or enter in terminal:
$> sudo apachectl restart

Comments
sffc
@ 29.05.2007 22:29 CET
There's another easy way to access httpd.conf. In Safari, go to this address:
file:///private/etc/httpd/httpd.conf
Open the file in Text Edit, and follow the above procedure, and save the file as you normally would.
There's another easy way to access httpd.conf. In Safari, go to this address:
file:///private/etc/httpd/httpd.conf
Open the file in Text Edit, and follow the above procedure, and save the file as you normally would.
My system is the leopard but i don´t have the httpd.conf in my system!!
You don't know how long I have been searching for the php activation for my Intel iMac. It's as if Apple never heard of such a thing! I write my own website code and couldn't test it out ... frustrating! You could tell Paulo Resende (21-01-2008) that I had to re-enter the commands a number of times before I actually got into the Apache directory. The $> entries were confusing me until I realized I didn't have to type them in.
[ Error writing httpd.conf: Permission denied ] I need the manual on verify and repair disk permissions.
add a comment
This blog is gravatar enabled.
Your email adress will never be published.
Comment spam will be deleted!