Reputation: 2745
having some issues getting PHP working and it's really frustrating.
I installed PHP from here: http://php-osx.liip.ch/
I have read and reviewed all of the tips/troubleshooting here: PHP code is not being executed, instead code shows on the page
I have: uncommented the LoadModule for php
I have: added the command/line that makes files saved as .php be interpreted as php
I have: restarted apache, stopped and started apache
When I go to localhost/test.php I see the raw source code from my php file:
<!doctype html>
<html>
<head>
<title> PHP Test </title>
</head>
<body>
<p>This is an HTML line. </p>
<?php echo “<p> This is a PHP line</p>”;
phpinfo();
?>
</body>
</html>
Any guidance appreciated!
Upvotes: 2
Views: 8428
Reputation: 1683
I did
$ sudo mv /private/etc/apache2/other/+php-osx.conf ~/Desktop
$ sudo apachectl start
and its working for me.
Upvotes: 1
Reputation: 547
Uncomment the following too from httpd.conf
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
Try that and with already uncomment Loadmodule for php, it should work LoadModule php5_module libexec/apache2/libphp5.so
then restart apache
I have faced the similar issue and then this fixed it.
sudo apachectl restart
More detail can be found from url: http://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-osx-10-11-el-capitan/
Upvotes: 7