PHP无法正常运行,Mac OS X El Capitan [英] PHP Not working, Mac OS X El Capitan
问题描述
在使PHP正常工作时存在一些问题,这确实令人沮丧.
having some issues getting PHP working and it's really frustrating.
我从此处安装PHP: http://php-osx.liip.ch/
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
我有:取消对php的LoadModule的注释
I have: uncommented the LoadModule for php
我已经:添加了使文件另存为.php的命令行/命令行解释为php
I have: added the command/line that makes files saved as .php be interpreted as php
我有:重新启动apache,停止并启动apache
I have: restarted apache, stopped and started apache
当我进入localhost/test.php时,我从php文件中看到了原始源代码:
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>
任何指导表示赞赏!
推荐答案
也从httpd.conf
Uncomment the following too from httpd.conf
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
尝试一下,并且已经取消对PHP的Loadmodule的注释,它应该可以工作 LoadModule php5_module libexec/apache2/libphp5.so
Try that and with already uncomment Loadmodule for php, it should work LoadModule php5_module libexec/apache2/libphp5.so
然后重新启动apache
then restart apache
我遇到了类似的问题,然后解决了这个问题.
I have faced the similar issue and then this fixed it.
sudo apachectl重新启动
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/
这篇关于PHP无法正常运行,Mac OS X El Capitan的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!