OSX Apache using wrong version of PHP

后端 未结 2 443
没有蜡笔的小新
没有蜡笔的小新 2020-12-05 10:17

I followed a guide which used home-brew to install the lastest version of php (5.4.8) on OSX Mountain Lion.

I then followed a guide which showed me how to setup and

相关标签:
2条回答
  • 2020-12-05 10:43

    Did you follow all the instructions provided in the Caveats?

    Run brew info php54 to see them again.

    Especially the line:

    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

    0 讨论(0)
  • 2020-12-05 10:43

    Apache is not aware of the homebrew version of PHP (i.e. /usr/bin/php). You see it on the command line because you've likely modified your PATH (i.e. /usr/local/bin/php).

    You can modify this in your httpd.conf file.

    I am not a fan of homebrew or other package libraries. Primarily because Mac OS X is built atop Unix. Furthermore, all but MySQL are installed natively. Here's an article on installing Apache, MySQL, and PHP on Mac OS X.

    Disclaimer: I wrote that article.

    0 讨论(0)
提交回复
热议问题