Zephilim Posted November 2, 2016 Share Posted November 2, 2016 I have installed php version 5.4 using homebrew (brew install homebrew/php/php54) and I can now use this version on the command line ok, which overrides the default installed version 5.5 which comes with OSX El-Capitan. Now I need to modify the apache config so that it too now runs 5.4 and not 5.5.38.Now, established wisdom says that I should be modifying /private/etc/apache2/httpd.conf. So the line under question is:169 LoadModule php5_module libexec/apache2/libphp5.sobut that libphp5.so, is rather general and doesn't look specific to either 5.4 or 5.5.In another article I found https://www.euperia.com/development/using-different-php-versions-osx-apache-homebrew/1441the httpd.conf file looks like this, where the appropriate line can be left uncommented according to specific php version you require for apache:119120 # LoadModule php5_module libexec/apache2/libphp5.so121 # LoadModule php5_module /usr/local/Cellar/php53/5.3.29/libexec/apache2/libphp5.so122 LoadModule php5_module /usr/local/Cellar/php54/5.4.36/libexec/apache2/libphp5.so123 # LoadModule php5_module /usr/local/Cellar/php55/5.5.20/libexec/apache2/libphp5.so124 # LoadModule php5_module /usr/local/Cellar/php56/5.6.4/libexec/apache2/libphp5.so125My installation of php54 by homebrew is located at /usr/local/Cellar/php54/5.4.45_6/ and when I run php --version I see:$ php --versionPHP 5.4.45 (cli) (built: Oct 1 2016 22:20:59)Copyright © 1997-2014 The PHP GroupZend Engine v2.4.0, Copyright © 1998-2014 Zend TechnologiesUnder /usr/local/Cellar/php54/5.4.45_6/, I can't find any reference to libphp5.so so that I can configure an absolute path to it (so essentially, under ../5.445_6/ I can't see a libexec/.. which I'm expecting somewhere to contain a libphp5.so that can be referenced).As a quick test, I configured it with /usr/local/Cellar/php54/5.4.45_6/libexec/apache2/libphp5.so, but since this file does exist, apache failed to start.So my question clearly is, how do I find the correct path to the 5.4 version of PHP, so that I can configure apache to load the module correctly on start up, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/302447-how-to-change-apache-php-version-installed-with-homebrew-on-osx/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.