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

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.

主站蜘蛛池模板: 黎川县| 宁城县| 息烽县| 许昌县| 金昌市| 黑山县| 济源市| 绥阳县| 淳化县| 育儿| 汽车| 彰武县| 贺兰县| 准格尔旗| 洪雅县| 思茅市| 永川市| 隆昌县| 仁怀市| 偃师市| 灌南县| 平罗县| 大关县| 会同县| 桦南县| 莫力| 永靖县| 扎鲁特旗| 独山县| 云安县| 磴口县| 乐山市| 北安市| 旺苍县| 华阴市| 丰镇市| 仁化县| 仁怀市| 西盟| 赤壁市| 平陆县|