I move the info.php file into a new folder called PHP.
I setup a new site that is pointed to the PHP folder.
Huh?
I turned on CGI Execution.
Good.
However, now when I browse to the info.php ("
http://localhost/PHP/info.php
") it downloads the page instead of rendering it in the browser. How do I get around that?
Launch Terminal.app, and use the following general sequence as a starting point for your set-up:
$ cd /etc
$ sudo cp php.ini.default php.ini
$ # nano is a command shell text editor. directions for its use are displayed at the bottom.
$ sudo nano php.ini # whatever changes you need to this file
$ cd /Library/Webserver/Documents/
$ echo "<?php phpinfo(); ?>" > phptest.php
$ sudo chown root:www phptest.php
$ sudo chmod u=rwx,g=rx,o=rx phptest.php
Restart the web server.
The above is the general configuration sequence for the php.ini file, and it sets up a stub phptest.php file in the default web directory.
There is no need to create a php subdirectory, and no need to place php files anywhere other than the default web directory location.
If the above sequence fails, check the web server logs for any available details on the failure.