Home > Backend Development > PHP Problem > What to do if mac php does not parse

What to do if mac php does not parse

藏色散人
Release: 2023-03-03 19:30:02
Original
2448 people have browsed it

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.

What to do if mac php does not parse

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
Copy after login

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
Copy after login

Restart apache afterwards:

sudo apachectl restart
Copy after login

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 文件路径 */
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template