I cannot get PHP to work on my computer. My browser prints out the php code rather than executing it.
The first thing I did was to open up the apache conf file and edit it to uncomment the php line
Opened file:
sudo nano /etc/apache2/httpd.conf
This is the line I uncommented in that file:
LoadModule php_module libexec/apache2/libphp5.so
I then restarted apache using:
sudo apachectl restart
Apache would run, http://127.0.0.1 would show "It works!" I then created a file called test.php, in which I put the following line of code:
<?php phpinfo(); ?>
In chrome I clicked file -> open file -> test.php, and all it printed was the code I had written.
I've also tried changing the line "User _www" in the conf file to
User myusername
I've tried changing the line "DirectoryIndex index.html" to:
DirectoryIndex index.php index.html index.htm
None of these changes have resulted in PHP script executing on my computer. Any help would be appreciated!