国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > Apache > 正文

使用IIS或Apache做PHP的服務(wù)器

2024-08-27 18:28:59
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

  aphache做服務(wù)器:

    安裝 apache 并進(jìn)行配置使其支持 php

  將 apache 安裝在 d:/website/apache 目錄中。apache 安裝過(guò)程需要輸入網(wǎng)站域名,本地調(diào)試使用localhost即可,安裝過(guò)程很簡(jiǎn)單,全圖形化界面,不再贅述。

  php解壓縮到 d:/website/php 目錄中
   然后找到 d:/website/php/php.ini-dist 文件,將其重命名為 php.ini,并復(fù)制到 c:/windows 目錄里。
    再將 d:/website/php/ 目錄中的 php5ts.dll 和 libmysql.dll 兩個(gè)文件,一起復(fù)制到 c:/windows/system 或 c:/windows/system32 目錄中。

  編輯 d:/apache/apache2/conf/httpd.conf 文件:
    首先找到 documentroot 一行,將其后的路徑修改為 web 服務(wù)的主目錄,例如:documentroot "d:/website/public_html";
    然后找到 directoryindex 一行,在行末加上 index.htm index.php,例如:directoryindex index.html index.html.var index.htm index.php

  為 apache 安裝 php:   編輯 d:/apache/conf/httpd.conf 文件:

  找到 #loadmodule ssl_module modules/mod_ssl.so 這行,在此行后增加一行:
  loadmodule php5_module d:/website/php/php5apache2.dll

  找到 addtype application/x-gzip .gz .tgz,在此行后增加三行:
  scriptalias /php/ "d:/website/php/"
  addtype application/x-httpd-php .php
  action application/x-httpd-php "/php/php-cgi.exe"

    d:/website/php/ 是指 php 5.03 的安裝目錄路徑,請(qǐng)視具體情況更改。

  重新啟動(dòng) apache 服務(wù)。

  到這里,apache + php 環(huán)境基本已經(jīng)配置完成,在 web 根目錄(以上例即 d:/website/public_html/ 目錄)中,用記事本創(chuàng)建一個(gè) phpinfo.php 文件,其內(nèi)容如下:

  <?
  echo phpinfo();
  ?>

  然后,在瀏覽器中打開(kāi) http://localhost/phpinfo.php ,如果看到 php 配置輸出信息,就說(shuō)明配置正常。

iis上運(yùn)行php
1.
默認(rèn)網(wǎng)站--屬性--主目錄--配置--添加
添加應(yīng)用程序擴(kuò)展名映射:
可執(zhí)行文件:c:/php/php.exe %s %s
擴(kuò)展名:.php
選定:腳本引擎、檢查文件是否存在
2.
默認(rèn)網(wǎng)站--屬性--主目錄--文檔-添加
index.php


或者:
默認(rèn)網(wǎng)站--屬性--主目錄--配置--添加
c:/php/php5isapi.dll
.php 

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 思茅市| 内丘县| 周宁县| 潮安县| 临海市| 丰宁| 拉孜县| 濮阳县| 晋中市| 遂溪县| 合作市| 舒兰市| 麻阳| 峨边| 河北省| 玛曲县| 临桂县| 灵璧县| 华安县| 沙河市| 镶黄旗| 山东| 南城县| 东乌珠穆沁旗| 砀山县| 建阳市| 开平市| 治县。| 西和县| 从江县| 中西区| 四子王旗| 阳城县| 太谷县| 古浪县| 来凤县| 青龙| 阿尔山市| 宜丰县| 湖州市| 桃源县|