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

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.

主站蜘蛛池模板: 平潭县| 云南省| 鲁山县| 营口市| 井陉县| 夹江县| 余姚市| 府谷县| 靖江市| 儋州市| 陵川县| 长治市| 噶尔县| 黔东| 通山县| 房产| 西盟| 临江市| 诸暨市| 寿阳县| 临西县| 伊通| 吴桥县| 吉林市| 常山县| 赤峰市| 民和| 曲沃县| 葫芦岛市| 乌审旗| 白水县| 东海县| 金溪县| 肥西县| 明光市| 黑山县| 古浪县| 六盘水市| 灌南县| 扶风县| 新巴尔虎右旗|