1.Windows下Apache修改目录后无法访问网页问题的解决方法。用 http://localhost 或 http://127.0.0.1 提示禁止访问。打开 conf 文件夹下的 httpd.conf (修改配置文件时,最好不要使用系统附带的记事本,而使用Notepad++或Dreamweaver等其他编辑软件,用编辑记事本可能会对其造成影响),找到下面文段
# # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # First, we configure the "default" to be a very restrictive set of # features. # <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory>
把 deny from all 改成 allow from all
2.Windows下Apache添加php后启动失败,添加php时教程都是说在conf 文件夹下的 httpd.conf的
#LoadModule vhost_alias_module modules/mod_vhost_alias.so添加下面代码(D:/WAMP部分需要修改为自己文件所在),但是老是启动失败 The requested operation has failed! ,这时要主要代码是不是复制的,如果是就试下把输入法切换到英文状态下,重新输入代码段中的2双双引号。
LoadModule php5_module "D:/WAMP/PHP/php5apache2_2.dll" PHPIniDir "D:/WAMP/PHP/" AddType application/x-httpd-php .php AddType application/x-httpd-php .htm AddType application/x-httpd-php .html
3.Windows下安装了apache+php+mysql但是php不能连接mysql,已经测试打开cmd命令行,输入
mysql -h localhost -u root -p 能正确连接mysql,说明mysql安装正确了。
这时应该注意是不是配置 php.ini 错误,重新打开php.ini修改
; extension_dir = “ext”
修改成:extension_dir ="D:\WAMP\PHP\ext"
记住前面没有分号;博主试了几个小时才发现问题所在