且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用BREW安装的PHP?

更新时间:2023-01-14 22:10:37

您必须让你的Apache使用您刚刚下载的PHP。

You have to make your Apache use the PHP that you just downloaded.


  • 打开的httpd.conf (我的是在 /etc/apache2/httpd.conf )并查找加载PHP模块行了,是这样的:

  • Open your httpd.conf (mine is at /etc/apache2/httpd.conf) and look for the line that loads the PHP module, something like:

的LoadModule php5_module路径/要/ PHP

然后,使其指向BREW为您安装与mcrypt的支持PHP。我的是在这条道路。您可以根据您所安装的PHP版本而异。

Then, make it point to the PHP that brew installed for you with mcrypt support. Mine was at this path. Yours can vary depending on the PHP version that you installed.

/usr/local/Cellar/php54/5.4.21/libexec/apache2/libphp5.so

最后,您将需要重新启动Apache服务器加载新的配置:

Finally you will need to restart your Apache server to load the new configuration:

须藤apachectl中重启