apache和php設定檔

來源:互聯網
上載者:User

標籤:

pache(2.4.17) •解壓,加入系統變數 •修改conf檔案夾中httpd.conf配置,配置各個檔案路徑

PHP(5.6.14) •解壓,加入系統變數 •配置常規限制,外掛程式等

 Mysql(5.6) •解壓,加入系統變數 •配置目錄路徑,CMD命令列安裝服務


 因為Apache,php,mysql,都需要加入環境變數,先解壓到安裝目錄,本人E:盤Apache網站根目錄是 E:\Apache;
Apache解壓到 E:\Apache\phpwin
MySQL解壓到 E:\mysql
 PHP解壓到E:\Apache \php

     Setp2.修改設定檔  Apache配置
1.修改apache 設定檔

apache24\conf\httpd.conf——主要是檔案目錄。 用記事本開啟C:\apache24\conf\httpd.conf     
  修改 37行 ServerRoot "c:/Apache24" => ServerRoot "E:/Apache/phpwin "(這裡輸入的是你解壓apache安裝包的位置)      
修改 217行 #ServerName www.example.com:80 => ServerName www.example.com:80 (去掉前面的#)      
修改 241行 DocumentRoot "c:/Apache24/htdocs" => DocumentRoot "E:/Apache/phpwin /htdocs"     
修改 242行 <Directory "c:/Apache24/htdocs"> => <Directory "E:/Apache/phpwin/htdocs">       
 修改 275行 DirectoryIndex index.html => DirectoryIndex index.html index.php index.htm (我們添加了index.php index.htm)   
 修改 358行 ScriptAlias /cgi-bin/  "c:/Apache24/cgi-bin/"  => ScriptAlias /cgi-bin/ "E:/Apache/phpwin/cgi-bin/"
 修改 374行 <Directory "c:/Apache24/cgi-bin"> => <Directory "E:/Apache/phpwin/cgi-bin">

2.添加 Apache支援PHP(在E:/Apache/phpwin/conf/httpd.conf 最後一行添加)

# php5 support   
LoadModule php5_module E:/Apache/phpwin/php5apache2_2.dll  
AddType application/x-httpd-php .php  
PHPIniDir E:/Apache/phpwin/php-5.3.1

 至此,httpd.conf 配置完成,儲存httpd.conf

將apache安裝到系統服務中(以管理員運行CMD)     
 在cmd中執行:E:/Apache/phpwin/bin/httpd -k install  幾個常用命令:net start apache2.4       //(版本號碼)啟動服務          net stop apache2.4



配置PHP  複製一份php.ini-development,並重新命名為php.ini,編輯php.ini    
 #把;error_log = php_errors.log 修改為  error_log= E:/Apache/phpwin/PHP54/tmp/php_errors.log #;

   #修改相關路徑  #上傳暫存路徑,別忘了建立對應的檔案夾

以下需要刪除源檔案前面的分號

extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_oci8_12c.dll ;Use with Oracle Database 12c Instant Client
extension=php_openssl.dll
extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
extension=php_shmop.dll

 

apache和php設定檔

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.