winsows服务器配置apache2.4+php5.6+mysql

mysql开INNODB引擎

skip-innodb   改成   #skip-innodb

default-storage-engine  改成  default-storage-engine=INNODB

Mysql数据库优化

数据库地址不能写localhost要用127.0.0.1

[mysqld]
skip-name-resolve #取消dns解析
skip-grant-tables#不需要密码
thread_concurrency=8#CPU合数*2

php配置

php官网下载:http://windows.php.net/download/   VC11 x64 Thread Safe(apache安全线程)(IIS用非安全线程)

VC11要下载c++2012运行库

解压到D盘。文件夹改名为”php”

跟目录下php.ini-production 改名 php.ini

3、打开php.ini  修改以下内容并删除前面的”;”

Extension_dir = “./” 改 extension_dir = “D:\php\ext”
cgi.force_redirect = 1 改 cgi.force_redirect = 0

以下内容去“;”

extension=php_curl.dll

extension=php_gd2.dll

extension=php_mbstring.dll

extension=php_mysql.dll

extension=php_mysqli.dll

extension=php_openssl.dll

extension=php_pdo_mysql.dll

apache配置

apache官网:http://httpd.apache.org/

点击Files for Microsoft Windows

点击ApacheHaus

下载zip和ssl

解压后打开httpd.conf

#LoadModule rewrite_module modules/mod_rewrite.so删除”#”

找Define SRVROOT,定义apache目录路径Define SRVROOT “C:\Program Files\Apache24”

删除Listen 80

所有Require all denied前加#

DirectoryIndex index.html改成DirectoryIndex index.html index.php

最后加入

LoadModule php5_module "d:/php/php5apache2_4.dll"
PHPIniDir "D:/php"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .htm
Listen 8080
Listen 8008
Listen 8800
<VirtualHost *:8080>
    DocumentRoot "D:/weba"
    <Directory "D:/weba">
        Options FollowSymLinks
        AllowOverride ALL
    </Directory>
</VirtualHost>
<VirtualHost *:8008>
    DocumentRoot "D:/liuman"
    <Directory "D:/liuman">
        Options FollowSymLinks
        AllowOverride ALL
    </Directory>
</VirtualHost>
<VirtualHost *:8800>
    DocumentRoot "D:/wza"
    <Directory "D:/wza">
        Options FollowSymLinks
        AllowOverride ALL
    </Directory>

</VirtualHost>

管理员权限cmd进入apache/bin目录运行httpd.exe -k install -n apache

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注