Installing PHP on Mac OS X Lion 10.7.5

Hi everyone,

I'm reading PHP & MySQL Novice to Ninja (5th edition) 2012.

I've installed MySQL and PHP in my Mac OS X Lion (10.7.5). And I'd like to check the following:

- Installing PHP (p. 407):

1. In the Finder menu bar, choose Go to folder and type /private/etc/apache2, before clicking go.
2. In the Finder window that opens find the httpd.conf. This is the Apache configuration file. By default, it's read only. Right click the file and choose Get info to open the file properties. Scroll down to the bottom of the httpd.conf info window to find the sharing & permissions setting. By default the settings are disabled. Click the lock to enable them. Enter password. To make this file editable, change the value in the Privilege column for everyone to Read & Write.

That's fine up to there. Then says (p.408):

3. Back in the finder window for the apache2 folder, right-click in the background of the folder window and choose get info to open the folder's properties. As in the previous step, set the Sharing & Permissions settings from everyone to Read & Write.

What I don't understand is what folder should I double click here as the apache2 folder has many folders inside.

---

When I finished the installation I then went on to "your first php script" (p.21)

I saved the today.php file in /Library/Webserver/Documents but got a window in Komodo saying:

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

That's why I was going back over the installation.

---

Thanks a lot.

I assume it’s telling you to set the /apache2/ folder’s permissions. You can either do that by clicking anywhere in the blank space inside that folder (i.e. not on any particular file) or by clicking the /apache2/ folder itself (that is, its actual name).

Off Topic:

Please don’t double post. If you feel a thread is in the wrong forum, just report it and we can move it. :slight_smile:

Hi Ralph:

Now I set the permissions for the apache2 folder, but still get this message when I try to save today.php:

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

I went over the installation:

  • Allowed web sharing.
  • Allowed permissions to read and write in the apache2 folder and the httpd.conf file.
  • Edited the httpf.conf with Komodo

#LoadModule php5_module libexec.apache2.libphp5.so (deleted the # to enable the line).

  • Restarted Apache in the Terminal:

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

Machine:∼ user$ cd/ private/etc
Machine:etc user$ sudo cp php.ini.default php.ini
Password: (type password)

  • Edited the php.ini folder by changing:

mysql.default_socket = /tmp/mysql.sock

and

mysqli.default_socket = tmp/mysql.sock

  • In the Terminal I wrote:

sudo/ usr/sbin/ apachectl restart

This is all following the book. What else should I check?

Thanks.