Apache.PHP和MySQL的配置

來源:互聯網
上載者:User

標籤:headers   步驟   red   director   dex   path   drivers   for   解析   

1.首先有Apache PHP MySQL的安裝包
2.在D盤建立一個檔案夾為myphp2017
2.解析Apache安裝包在myphp2017裡面
3.開啟Apache下面的conf下面的httpd.conf,進行步驟修改
   ①將ServerRoot的路徑改為 "D:\myphp2017\Apache"
   ②將DoDocumentRoot 的路徑改為 "D:\myphp2017\Apache\htdocs"
   ③將DoDocumentRoot下面的Directory 的路徑也改為 "D:\myphp2017\Apache\htdocs"
   ④將ScriptAlias 處改為ScriptAlias /cgi-bin/ "D:\myphp2017\Apache\cgi-bin"
   ⑤在Directory 處改為"D:\myphp2017\Apache\cgi-bin"
     改後為
 <Directory "D:\myphp2017\Apache\cgi-bin">
    AllowOverride None
    Options None
    Require all granted
    </Directory>


     Apache就配置好了


4.將PHP安裝包解析到myphp2017裡面
 
5.在Apache下面的conf下面的httpd.conf,進行步驟修改
  ①在httpd.conf最後面加PHP配置
   PHPIniDir "D:\myphp2017\php-7.0.23"
   LoadModule php7_module "D:\myphp2017\php-7.0.23\php7apache2_4.dll"
   AddType application/x-httpd-php .php
  ②在D:\myphp2017\php-7.0.23下面的php.ini-development或者php.ini-production進行複製一份
    其名為php.ini
  ③php.ini中extension_dir修改路徑為extension_dir = "D:\myphp2017\php-7.0.23\ext"
php.ini中資訊配置
enable_dl = On
cgi.force_redirect = 0
cgi.fix_pathinfo=1
fastcgi.impersonate = 1
cgi.rfc2616_headers = 1
  PHP配置好了

6.安裝MySQL-5.5.57-winx64.mis,到myphp2017


7.配置Apache虛擬目錄
 
  ①找到C:\Windows\System32\drivers\etc下面的hosts
  ②在hosts裡最後面加  127.0.0.1  www.blog.com(本機名  地址)
  ③在Apache下面的conf下面的httpd.conf裡
     處Virtual hosts下面那行去掉#
  ④找到D:\myphp2017\Apache\conf\extra下面的httpd-vhosts.conf
   ⑤將其裡面全部注釋,在後面加
<VirtualHost *:80>
 #郵箱名
    ServerAdmin [email protected]
   
    DocumentRoot "D:\myphp2017\blog\php"
    ServerName www.blog.com
 DirectoryIndex  login.php
    ErrorLog "logs/blog.com-error.log"
    CustomLog "logs/blog.com-access.log" common
 <Directory "D:\myphp2017\blog\php">
  Options Indexes FollowSymLinks
  AllowOverride None
  Require all granted
 </Directory>
</VirtualHost>
 
 


 

Apache.PHP和MySQL的配置

聯繫我們

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