You need to change the PHP version of Mac from 5.5 to 5. 3. first, you need to delete the built-in Version 5.5 and delete the file as follows: {code ...} note: After Apache is restarted, phpinfo () is still displayed. then use brew to install php. {code ...} next, according to the online tutorial...
Change the PHP version of Mac from 5.5 to 5.3 as needed.
First, you need to delete the built-in Version 5.5 and delete the file as follows:
/private/etc/ sudo rm -rf php-fpm.conf.default php.ini php.ini.default/usr/bin/ sudo rm -rf php php-config phpdoc phpize/usr/include sudo rm -rf php/usr/lib sudo rm -rf php/usr/sbin sudo rm -rf php-fpm/usr/share sudo rm -rf php/usr/share/man/man1 sudo rm -rf php-config.1 php.1 phpize.1/usr/share/man/man8 sudo rm -rf php-fpm.8
Note: After Apache is restarted, phpinfo () is still displayed.
Then use brew to install php.
brew install php53 --with-apache
Then, the following lines of code are run according to the online tutorial:
Echo 'export PATH = "$ (brew -- prefix homebrew/php/php53)/bin: $ PATH" '>> ~ /. Bash_profile # for php echo 'export PATH = "$ (brew -- prefix homebrew/php/php53)/sbin: $ PATH" '>> ~ /. Bash_profile # for php-fpm echo 'export PATH = "/usr/local/bin:/usr/local/sbin: $ PATH" '>> ~ /. Bash_profile # for other brew install soft source ~ /. Bash_profile # Update Configuration
Then, modify the configuration file httpd. conf in apache:
LoadModule php5_module/usr/local/opt/php53/libexec/apache2/libphp5.so # originally: LoadModule php5_module libexec/apache2/libphp5.so # This new php53. so file has been determined.
After Apache is restarted, phpinfo () is not displayed.
Reply content:
Change the PHP version of Mac from 5.5 to 5.3 as needed.
First, you need to delete the built-in Version 5.5 and delete the file as follows:
/private/etc/ sudo rm -rf php-fpm.conf.default php.ini php.ini.default/usr/bin/ sudo rm -rf php php-config phpdoc phpize/usr/include sudo rm -rf php/usr/lib sudo rm -rf php/usr/sbin sudo rm -rf php-fpm/usr/share sudo rm -rf php/usr/share/man/man1 sudo rm -rf php-config.1 php.1 phpize.1/usr/share/man/man8 sudo rm -rf php-fpm.8
Note: After Apache is restarted, phpinfo () is still displayed.
Then use brew to install php.
brew install php53 --with-apache
Then, the following lines of code are run according to the online tutorial:
Echo 'export PATH = "$ (brew -- prefix homebrew/php/php53)/bin: $ PATH" '>> ~ /. Bash_profile # for php echo 'export PATH = "$ (brew -- prefix homebrew/php/php53)/sbin: $ PATH" '>> ~ /. Bash_profile # for php-fpm echo 'export PATH = "/usr/local/bin:/usr/local/sbin: $ PATH" '>> ~ /. Bash_profile # for other brew install soft source ~ /. Bash_profile # Update Configuration
Then, modify the configuration file httpd. conf in apache:
LoadModule php5_module/usr/local/opt/php53/libexec/apache2/libphp5.so # originally: LoadModule php5_module libexec/apache2/libphp5.so # This new php53. so file has been determined.
After Apache is restarted, phpinfo () is not displayed.
Step 1: first check whether the result is php5.3 in the command line php -- version.
Part 2: Check whether/usr/local/opt/php53/libexec/apache2/libphp5.so has this file.
I tried this idea when I first played OSX. Later I used Python, virtualenv, ruby rvm, and so on. We do not recommend that you use OSX for Linux.
It's time to sacrifice the powerful weapon: phpbrew
Brew follows. That's not enough. It's so annoying.
Install this directly: http://php-osx.liip.ch/
You can use nginx to run different versions, which is more convenient than apache. Of course, you can use apache to proxy different versions of php.