简体   繁体   中英

PHP Not working, Mac OS X El Capitan

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!

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/

I did

$ sudo mv /private/etc/apache2/other/+php-osx.conf   ~/Desktop
$ sudo apachectl start

and its working for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM