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

Time for action — creating a quick info page

We are going to double-check that Apache can render PHP scripts by quickly creating a phpinfo page that will display a wide array of data about your configuration.

  1. Open your text editor.
  2. Create a new file that contains the following code:
    <?php phpinfo(); ?>
    
  3. Save the file with the name, info.php, and save that file in the following location: /Library/WebServer/Documents/info.php.
  4. Open your browser.
  5. Navigate your browser to http://localhost/info.php.
  6. Your browser will display the following page:
    Time for action — creating a quick info page

What just happened?

We used our text editor to create a file called info.php that contained a special PHP function called phpinfo. We saved the info.php file into the folder: /Library/Webserver/Documents. This folder is the default location (in Mac OS X only) for all of the files that your Apache service will display. When your browser hit the info.php page, the phpinfo looked at your PHP installation and returned an HTML file with details about your configuration. You can tell that there is a lot going on here. Feel free to poke around and look at some of the information before we move on.

Fine tuning Apache

We finally have our basic web development environment set up. However there are a few things we'll need to adjust in Apache in order for us to build our application; the first of which is enabling a great built-in module called mod_rewrite.

主站蜘蛛池模板: 高邑县| 永靖县| 沙坪坝区| 久治县| 绥德县| 上思县| 安吉县| 洛浦县| 石城县| 富锦市| 曲麻莱县| 平顶山市| 五大连池市| 隆林| 泰来县| 景宁| 钟祥市| 宝清县| 阳信县| 酉阳| 苏尼特左旗| 新龙县| 阜新市| 浦城县| 通城县| 镇雄县| 靖州| 沙雅县| 镇康县| 宜宾县| 金川县| 通城县| 新竹市| 肥东县| 赞皇县| 布尔津县| 左权县| 宝坻区| 拜城县| 东明县| 咸阳市|