Apache2.4+PHP5.6+Mysql5.6


Apache2.4安裝配置

  1. 解壓Apache2.4
    找到 httpd.conf 文件,用記事本打開修改:
    ServerRoot "D:/Apache24"
           Listen 80                          //80端口
           ServerName localhost:80           //一般為localhost
           DocumentRoot "D:/PhpstormProjects" 
          <Directory "D:/PhpstormProjects">
          ScriptAlias /cgi-bin/ "D:/PhpstormProjects"
          <Directory "D:/Apache24/cgi-bin">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options  FollowSymLinks                        //禁止列出目錄
    
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride None
    
    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>
  1. 將Apache加入到window服務啟動項里面
    win+R->cmd 進入Apche\bin目錄,執行
    httpd.exe -k install -n "Apache24"

PHP安裝配置

1.解壓PHP5.6
復制 php.ini-development 重命名為php.ini     //php.ini為php的配置文件
為Apache服務添加php支持
在 httpd.conf 中添加
# php5 support
LoadModule php5_module D:/php5/php5apache2_4.dll
AddType application/x-httpd-php .php .html .htm
# configure thepath to php.ini
PHPIniDir "D:/php5"

Mysql安裝配置

  1. 解壓Mysql5.6
    復制 my-default.ini 重命名為 my.ini //my.ini 為mysql配置文件
    修改 my.ini
    basedir =D:\Mysql5.6
    datadir = D:\Mysql5.6\data

    修改mysql占用內存過大:
    innodb_buffer_pool_size =1M
    join_buffer_size = 1M
    sort_buffer_size = 1M
    read_rnd_buffer_size = 1M
    performance_schema_max_table_instances=400
    table_definition_cache=400
    table_open_cache=256

  2. 以管理員身份運行cmd
    進入mysql\bin目錄下
    輸入:mysqld -install 安裝mysql
    啟動: net start mysql
    登錄:mysql -u root -p

  3. 修改 php.ini 連接mysql
    找到:

	 ;On windows:
     ;extension_dir = "ext"
     ;extension=php_mysql.dll
     ;extension=php_mysqli.dll

去掉冒號重啟Apache


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM