官术网_书友最值得收藏!

Time for action — making sure that Apache can connect to PHP

In order to create a web application, Apache needs to be able to run the PHP code. So, we are going to check that Apache can access PHP.

  1. Use Finder to navigate to the following folder: /etc/apache2.
  2. Open the file named httpd.conf in your text editor.
  3. Look through the file, and find the following line (it should be around line 116):
    #LoadModule php5_module libexec/apache2/libphp5.so 
    
  4. Remove the hash (#) symbol that is in front of this string to uncomment this line of the config file. It's possible that your configuration file may already have this uncommented. If it does, then you don't have to change anything. Regardless, the end result should look as follows:
    LoadModule php5_module libexec/apache2/libphp5.so 
    
  5. Open Terminal.
  6. Restart Apache by running the following command:
    sudo apachectl restart 
    

What just happened?

We opened Apache's main configuration file, httpd.conf, and uncommented a line so that Apache can load PHP. We then restarted the Apache server, so that the updated configuration would take effect.

主站蜘蛛池模板: 南京市| 运城市| 开江县| 德惠市| 平湖市| 铜山县| 财经| 岫岩| 日照市| 上蔡县| 周口市| 博爱县| 富阳市| 手游| 凯里市| 兴化市| 宝鸡市| 梨树县| 西华县| 阿勒泰市| 和硕县| 永德县| 江西省| 盐城市| 台前县| 韩城市| 吉木萨尔县| 宁陵县| 白银市| 龙南县| 柞水县| 永宁县| 邢台县| 无棣县| 荥经县| 德江县| 新竹市| 景东| 义乌市| 灌南县| 密山市|