Home > Article > Backend Development > What to do if mac php does not parse
The solution to mac php not parsing: first find the apache2 configuration file; then modify the PHP extension path; finally restart apache through the "sudo apachectl restart" command.
Recommended: "PHP Video Tutorial"
Mac does not use apache Solution to parsing PHP (or wrong PHP version)
After upgrading Mac to EI Caption, I found that the apache configuration has been reset. Record the solution steps:
Configure in apache2 Just modify the extension path of PHP in the file:
vi /etc/apache2/httpd.conf
The apache configuration file that comes with Mac loads version PHP5.5. If you need to load the version you installed, please specify
Customized PHP installation path.
Loading path example (the path configured on my Mac):
LoadModule php5_module /usr/local/Cellar/php56/5.6.16/libexec/apache2/libphp5.so
Restart apache afterwards:
sudo apachectl restart
Other tips:
Command line view phpinfo:
php -i /* 有用的参 */ extension_dir => /usr/local/Cellar/php56/5.6.16/lib/php/extensions/no-debug-non-zts-20131226 => /usr/local/Cellar/php56/5.6.16/lib/php/extensions/no-debug-non-zts-20131226 Loaded Configuration File => /usr/local/etc/php/5.6/php.ini /* 加载的 php.ini 文件路径 */
The above is the detailed content of What to do if mac php does not parse. For more information, please follow other related articles on the PHP Chinese website!