doutongxuan1614 2017-01-28 17:50
浏览 207

无法在mac中运行localhost

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.

  • 写回答

1条回答 默认 最新

  • duanqie8549 2017-01-28 19:32
    关注

    You must load php module in /etc/apache2/http.conf by uncommenting the line (by removing the heading #):

    LoadModule php5_module libexec/apache2/libphp5.so
    
    评论

报告相同问题?