Installing PHP on Mac OS X Lion 10.7.5

I was reading PHP and MySql Novice to Ninja by Kevin Yank. I've decided to do the manual installation of MySql and PHP. I thought everything went fine. But when I open Komodo and try to save the first exercise, today.php I get a message that says:


"There was an error attempting to save today.php. Permission denied".


First I did a manual installation of MySql. That's working fine.


In the chapter explaining the manual installation of PHP, the book says:


- Allow web sharing.

- Allow permissions to read and write in the apache2 folder and the httpd.conf file.

- Edit the httpf.conf with Komodo:


Find this line:


#LoadModule php5_module libexec.apache2.libphp5.so. And delete the # to enable it.


- Restart Apache in the Terminal:


Machine:∼ user$ sudo /usr/sbin/apachectl restart


- Check http://localhost, which is running fine.


- In the terminal write:


Machine:∼ user$ cd/ private/etc

Machine:etc user$ sudo cp php.ini.default php.ini

Password: (type password)


- Edit the php.ini folder by changing:


mysql.default_socket = /var/mysql/mysql/sock


to


mysql.default_socket = /tmp/mysql.sock


and


mysqli.default_socket = /var/mysql/mysql/sock


to


mysqli.default_socket = tmp/mysql.sock


- In the Terminal I write:


sudo/ usr/sbin/ apachectl restart


I'm using Mac OS X Lion 10.7.5 . And I'm following the exact instructions in the book...Any ideas why I have that error?


Thanks a lot!

MacBook Pro (15-inch Late 2011), Mac OS X (10.7.5)

Posted on Mar 27, 2013 4:23 AM

Reply
2 replies

Mar 27, 2013 7:41 AM in response to Planeta-Aleph

I expect you are not saving into a directory that you have write access to.


For example, you are saving directly into etc instead of somewhere in your User directories. There may be a parameter that specifies the default save location, or you may deliberately have to navigate there, or you may have to use:


cd /Users/<your_id>/<your_favorite directory>...


... to specify the "standard place" from which you intend to open and save your documents for this project.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Installing PHP on Mac OS X Lion 10.7.5

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.