简体   繁体   中英

Can not run localhost in mac

I am trying to use PHP in mac. But when I try to run php file it print the php codes. Not execute that php code. So I search some sources and try to solve. But nothing helps me. Now I am trying to execute apachectl -S from terminal. But I am getting following error. Please let me any idea to resolve my issue.

Prabus-MacBook-Pro:bin prabuganesan$ apachectl -S
VirtualHost configuration:
ServerRoot: "/usr"
Main DocumentRoot: "/Library/WebServer/Documents"
Main ErrorLog: "/private/var/log/apache2/error_log"
Mutex default: dir="/private/var/run/" mechanism=default 
Mutex mpm-accept: using_defaults
PidFile: "/private/var/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="_www" id=70 not_used
Group: name="_www" id=70 not_used
Prabus-MacBook-Pro:bin prabuganesan$

Please let me any idea.

您必须通过取消注释该行(通过删除标题# )在/etc/apache2/http.conf加载php模块:

LoadModule php5_module libexec/apache2/libphp5.so

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM