wamp的手动安装

Wamp的手动安装

(http://www.cnblogs.com/homezzm/archive/2012/08/01/2618062.html)

一、Apache2.4安装

1、修改Apacheconfhttpd.conf文件

              Define SRVROOT "E:/wamp/Apache24"

2、查看端口是否被占用      在cmd下用命令netstat -a查看

3、接下来需要配置安装Apache的主服务,有了它,Apache才可启动:

E:wampApache24in>httpd.exe -k install -n Apache24   

其中,Errors reported here must be corrected before the service can be started.意思是,若该句话后面有错误信息,则表示服务安装失败,需要先改正错误。若没有,则成功。

备注:       若Apache服务器软件不想用了,想要卸载,需要先卸载apache服务(切记,若直接删除安装路径的文件夹,会有残余文件在电脑,可能会造成不必要的麻烦)

在CMD命令窗口,输入如下(建议先停止服务再删除):

sc delete apache

apache是Apache服务器的服务名

二、PHP

1、下载VC11 x64 Thread Safe (PHP 5.6 (5.6.23))

2、在系统环境变量PATH中添加 E:wampphp;E:wampphpext; 重启后生效

3、PHP的配置:

如果没有php.ini-dist文件可使用php.ini-development文件并更改名称为php.ini(留个备份,好习惯)

php.ini-development 开发用的

php.ini-produciton 生产机用的

修改php.ini

default_charset = "UTF-8"

extension_dir = "E:/wamp/php/ext"

将extension=php_exif.dll、php_gd2.dll、php_imap.dll、php_mbstring.dll、php_mcrypt.dll、php_mime_magic.dll、php_mysql.dll、php_mysqli.dll、php_pdf.dll前面的分号“;”去掉。

4、      其它配置

在写php程序中有时会出现这样的警告:PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in D:xxxxxxxxx.php on line 10 。

这是因为PHP所取的时间是格林威治标准时间,所以和你当地的时间会有出入格林威治标准时间和北京时间大概差8个小时左右,我们可以按照下面的方法解决:1、在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即<?phpdate_default_timezone_set("PRC");?>就可以了。

2、在php.ini中设置date.timezone的值为PRC,设置好以后的为:date.timezone=PRC,同时取消这一行代码的注释,即去掉前面的分号就可以了。

三、MySQL

       http://jingyan.baidu.com/article/597035521d5de28fc00740e6.html

1、修改my.ini

[mysql]

# 设置mysql客户端默认字符集

default-character-set=utf8

[mysqld]

# 设置mysql的安装目录

basedir = E:/wamp/mysql

# 设置mysql数据库的数据的存放目录

datadir = E:/wamp/mysql/data

#设置3306端口

port = 3306

# server_id = .....

# 允许最大连接数

max_connections=200

# 服务端使用的字符集默认为8比特编码的latin1字符集

character-set-server=utf8

# 创建新表时将使用的默认存储引擎

default-storage-engine=INNODB

2、安装MySQL

E:wampmysqlin>mysqld -install

Service successfully installed.

3、启动MySQL

net start mysql

4、登录MySQL

默认没有密码:输入mysql -uroot -p ,

设置密码的方法:mysqladmin -u root -p password 密码。

四、phpmyadmin的安装

解压到web目录,访问即可

如果php安装目录里没有php5apache2_2.dll,一定是下载的版本不对。

官网左边有几段文字:

Which version do I choose?

If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP。。。。

所以你下载V6C versions of PHP

VC6 x86 Non Thread Safe

VC6 x86 Thread Safe

一个是Thread Safe,一个是Non Thread Safe,

结果,Non Thread Safe版的php在安装过程中,没有Apache的选项:

select the web server you wish to setup

IIS FastCGI

Other CGI

Do not setup a web server

而Thread Safe版的安装过程中有Apache 2.2.x Module选项:

select the web server you wish to setup

Apache 2.2.x Module

Apaceh CGI

IIS FastCGI

IIS CGI

NSAPI

Xitami

NetServe Web Server

Other CGI

Do not setup a web server】

------------------------------------------------------------------------------------------------------

PHP下载的时候有几个不同版本选择。那就是VC6 X86和VC9 X86。

首先我来解答:

VC6是什么?

VC6就是legacy Visual Studio 6 compiler,就是使用这个编译器编译的。

VC9是什么?

VC9就是the Visual Studio 2008 compiler,就是用微软的VS编辑器编译的。

那我们如何选择下载哪个版本的PHP呢?

如果你是在windows下使用Apache+PHP的,请选择VC6版本;

如果你是在windows下使用IIS+PHP的,请选择VC9版本;

那Non Thread Safe是什么?

Non Thread Safe就是非线程安全;

Thread Safe 是什么?

Non Thread Safe 是线程安全;

官方并不建议你将Non Thread Safe 应用于生产环境,所以我们选择Thread Safe 版本的PHP来使用。

PHPIniDir "E:/Program Files/PHP"

[

    如果你在链接MySql数据库的时候出现

Fatal error: Call to undefined function mysql_connect() in C:xxxxx.php

那就是因为你没有增加此属性。

]

原文地址:https://www.cnblogs.com/acmwangpeng/p/5672185.html