How to: Get PHP working on Mac OS X 10.5 Leopard
After updated my mac to the latest version of mac leopard my php installation broke, I guess because Leopard installed Apache2 and I was using Apache1.3 which was what OSX 10.4 came with. So to get PHP5 working with Mac OS X 10.5 Leopard. Do the following:
1. Launch the Terminal its located in applications/utilities
2. In Terminal type: cd /private/etc/apache2
3. Once your in the directory “/private/etc/apache2”, using what ever text editor you like open the file named httpd.conf (if your using textmate text editor, you can do, mate ./httpd.conf)
4. Once you open the httpd.conf file now look for the following line:
“#LoadModule php5_module libexec/apache2/libphp5.so” Once you find it, it’s somewhere around line number 114, uncomment the line So it should look something like this:
LoadModule php5_module libexec/apache2/libphp5.so
5. After doing all that now back in terminal type this command: cd /private/etc/apache2/users
6. Once in that directory open the file with your account username (ex. my file would be named, FernyB.conf)
7. Delete all contents inside the file
8. Start the web server or restart it by going into System Preferences > Web Sharing
9. In Terminal type: open /Library/WebServer/Documents (that should open up finder in that location)
10. Now Create a file called phpinfo.php and place it in /Library/WebServer/Documents
11. Open up phpinfo.php and type the following into phpinfo.php
12. Save and close phpinfo.php13. Now with your favorite web browser safari go to http://127.0.0.1/phpinfo.php
14. Now you should see the PHP Information page
15. The php.ini file will be located in /etc
16. In the directory /etc you will need to rename or copy and rename the file php.ini.default
17. In the directory /etc should have a file named php.ini
18. Now restart the web server, System Preferences > Web Sharing
19. That’s all.
November 7th, 2007 at 2:33 am
I’m on Leopard too 🙂
We are too addicted…