找不到httpd.conf PHP模块

时间:2017-01-02 15:59:20

标签: php apache httpd.conf

我尝试按照https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions

中的步骤设置PHP

我安装了php brew install php71 --with-httpd24

但是当我打开文件 /usr/local/etc/apache2/2.4/httpd.conf 时,php模块不在那里,我没有任何 LoadModule php7_module

我错过了什么? 提前谢谢!

1 个答案:

答案 0 :(得分:0)

Most likely your Apache http server is not able to understand what the .php file is because the httpd.conf configuration file is not set to load php module. Make sure php installed yum install php

check the existence of php files

    $ ls /etc | grep php
    php.d 
    php.ini

The most important thing we need to check is that there is a php module

    $ ls /etc/httpd/modules/ | grep php
    libphp5.so

We need to add the following line somewhere in the /etc/httpd/conf/httpd.conf file. Find the place in the document where all the LoadModule commands are by entering /LoadModule and pressing enter, than add the line there.

LoadModule php5_module modules/libphp5.so

Restart apache

    $ apachectl restart