Apache和php安裝

來源:互聯網
上載者:User

1.安裝Apache包,php直接解壓縮就可以

2.將c:\php路徑加入到系統變數path中

4.在資源管理員中進入 php 的安裝目錄,將 php.ini-dist 或 php.ini-recommended 複製一份,命名為 php.ini。然後開啟 php.ini。

;extension=php_mysql.dll

將前面的 ; 號去掉, 改成:

extension=php_mysql.dll

找到:

extension_dir = “./”

將其改為你的 php 安裝目錄下 ext 子目錄的絕對路徑。例如我的:

extension_dir = “D:\php\ext\”

這步很重要 。否則接下來 php 會找不到 php_mysql.dll 模組,無法裝載。

5.修改http.conf

DocumentRoot "C:/php/mywork" 
....
<Directory "C:/php/mywork">
....

#以下內容是新加的

LoadModule php5_module "c:/PHP/php5apache2_2.dll"
PHPIniDir "c:/PHP"   

DirectoryIndex index.html 改為
DirectoryIndex index.php index.html

#AddType application/x-gzip .gz .tgz下面加入
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html

 

6.測試php

<?phpphpinfo();?>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.