1.安装mysql
按照教程步骤
2.安装apache
测试在浏览器里面输入 http://localhost, 出现 It works表示成功。
3.安装php
APACHE中的conf目录修改httpd.conf
增加如下行:
<IfModule mime_module> 字段里面增加如下两行
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
增加模块:
LoadModule php5_module E:/php-5.2.6-Win32/php5apache2_2.dll
php.ini放在windows目录下面
去掉mysql前面的分号
把php5ts.dll, libmysql拷贝到C:\\windows\\system32里面
测试php是否正确
<?php
phpinfo();
php>
出现undefined mysql_connect错误的原因:
1.没有把libmysql拷贝到C:\\windows\\system32里面
2.没有修改mysql前面的分号
3.修改extend_dir指向lib库
得修改如下内容:
DocumentRoot "E:/www"
<Directory "E:/www">
#
# 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.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory> |