OSX的Apache使用PHP的版本错误 [英] OSX Apache using wrong version of PHP
问题描述
我跟着它使用的家用酿造安装PHP(5.4.8)的最新版本的OSX山狮。
I followed a guide which used home-brew to install the lastest version of php (5.4.8) on OSX Mountain Lion.
我再接着一个指南,教我如何设置和使用OSX上的pre-Apache安装。
I then followed a guide which showed me how to setup and use the pre-installed apache on OSX.
然而,当我尝试运行了一个基础Symfony的项目,我得到了一堆关于在php.ini中失踪date.timezone错误。
However when I try running up a base Symfony 2 project I get a bunch of errors relating to missing date.timezone in the php.ini.
不过,我有这个正确的设置php.ini中,但做一个快速的phpinfo()中的Symfony项目显示,其使用PHP pinstalled(5.3)版本的旧$ P $,而不是新的。
However I have this correctly setup the php.ini but doing a quick phpinfo() in the Symfony project shows that its using the old preinstalled version of php (5.3) rather than the new one.
在终端,如果我输入的PHP
&安培; PHP -v
,它显示正在使用正确的新版本。
In terminal if I type which php
& php -v
, It shows the correct new version is being used.
但的phpinfo()
显示
推荐答案
你遵循注意事项中提供的所有指令?
Did you follow all the instructions provided in the Caveats?
运行 BREW信息php54
再次见到他们。
特别是行:
要在Apache中启用PHP以下内容添加到httpd.conf文件和重新启动Apache :结果
的LoadModule php5_module /usr/local/Cellar/php54/5.4.8/libexec/apache2/libphp5.so
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/Cellar/php54/5.4.8/libexec/apache2/libphp5.so
这篇关于OSX的Apache使用PHP的版本错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!