###php版本: 5.2.17
##apache2.2版本 2.2 ##第一种情况:httpd。conf使用的是handler、可以访问phpinfo的那个函数的php页面、其他页面返回空页面;
##不是404!!不是403!!##第二种情况使用fastcgi,全部php页面都是403! 文件夹权限看了ok、httpd.conf的权限设置也搞过、但是没搞成!!配置1如下:第三行的注释是故意的、因为不注释启动不了# install handler begin
LoadModule php5_module "E:/PHP/php5apache2_2.dll"
#PHPIniDir "E:/php"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html# install handler fastcgi
#LoadModule fcgid_module modules/mod_fcgid.so
#FcgidInitialEnv PHPRC "E:/php"
#AddHandler fcgid-script .php
#FcgidWrapper "E:/PHP/php-cgi.exe" .php ServerRoot "E:/Program Filesn/Apache2.2"
Listen 80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon
</IfModule>
</IfModule>
ServerAdmin [email protected]
DocumentRoot "G:/etone_www"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "G:/etone_www">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.php default.php index.html
</IfModule>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
ErrorLog "logs/error.log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access.log" common
</IfModule>
<IfModule alias_module>
# documents in the target directory are treated as applications and
ScriptAlias /cgi-bin/ "E:/Program Filesn/Apache2.2/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "E:/Program Filesn/Apache2.2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
DefaultType text/plain
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
#MaxRanges unlimited
# Multi-language error messages
# Various default settings
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
##apache2.2版本 2.2 ##第一种情况:httpd。conf使用的是handler、可以访问phpinfo的那个函数的php页面、其他页面返回空页面;
##不是404!!不是403!!##第二种情况使用fastcgi,全部php页面都是403! 文件夹权限看了ok、httpd.conf的权限设置也搞过、但是没搞成!!配置1如下:第三行的注释是故意的、因为不注释启动不了# install handler begin
LoadModule php5_module "E:/PHP/php5apache2_2.dll"
#PHPIniDir "E:/php"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html# install handler fastcgi
#LoadModule fcgid_module modules/mod_fcgid.so
#FcgidInitialEnv PHPRC "E:/php"
#AddHandler fcgid-script .php
#FcgidWrapper "E:/PHP/php-cgi.exe" .php ServerRoot "E:/Program Filesn/Apache2.2"
Listen 80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon
</IfModule>
</IfModule>
ServerAdmin [email protected]
DocumentRoot "G:/etone_www"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "G:/etone_www">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.php default.php index.html
</IfModule>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
ErrorLog "logs/error.log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access.log" common
</IfModule>
<IfModule alias_module>
# documents in the target directory are treated as applications and
ScriptAlias /cgi-bin/ "E:/Program Filesn/Apache2.2/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "E:/Program Filesn/Apache2.2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
DefaultType text/plain
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
#MaxRanges unlimited
# Multi-language error messages
# Various default settings
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
fastcgi的模块mod_fcgid-2.3.6-win32-x86、是Thread safe版本的;
我的php是php-5.2.17-Win32-VC6-x86、也是threadsafe版本的;
apache是httpd-2.2.22-win32-x86-no_ssl(1)、启动的时候“好像说”php要thread safe版本配置2:
# install handler begin
#LoadModule php5_module "E:/PHP/php5apache2_2.dll"
#PHPIniDir "E:/php"
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php .html# install handler fastcgi
LoadModule fcgid_module modules/mod_fcgid.so
FcgidInitialEnv PHPRC "E:/php"
AddHandler fcgid-script .php
FcgidWrapper "E:/PHP/php-cgi.exe" .php ServerRoot "E:/Program Filesn/Apache2.2"
Listen 80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon
</IfModule>
</IfModule>
ServerAdmin [email protected]
DocumentRoot "G:/etone_www"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "G:/etone_www">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.php default.php index.html
</IfModule>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
ErrorLog "logs/error.log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access.log" common
</IfModule>
<IfModule alias_module>
# documents in the target directory are treated as applications and
ScriptAlias /cgi-bin/ "E:/Program Filesn/Apache2.2/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "E:/Program Filesn/Apache2.2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
DefaultType text/plain
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
#MaxRanges unlimited
# Multi-language error messages
# Various default settings
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
http://topic.csdn.net/u/20110804/17/0b7978b9-0e85-4e5e-8782-ba3b203b9fe0.html?50600
帖子里的版本吧.包括重新安装apache.你的第三行php.ini文件有错所以启动不了
至于你能访问phpinfo 但是无法访问其他目录文件,你的其他目录文件是在此web目录下吗?还是其他盘?
你先装我上面说的版本php后再来研究吧
apache 有日志的 可以复制出来看看.一般都可以解决问题
有没有类似apache测试httpd。conf文件的命令、httpd.ext -t
[Sat Mar 17 09:52:37 2012] [notice] Parent: Created child process 5368
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.171.1 for ServerName
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.171.1 for ServerName
[Sat Mar 17 09:52:37 2012] [notice] Child 5368: Child process is running
[Sat Mar 17 09:52:37 2012] [info] Parent: Duplicating socket 352 and sending it to child process 5368
[Sat Mar 17 09:52:38 2012] [notice] Child 5368: Acquired the start mutex.
[Sat Mar 17 09:52:38 2012] [notice] Child 3104: Released the start mutex
[Sat Mar 17 09:52:38 2012] [notice] Child 5368: Starting 64 worker threads.
[Sat Mar 17 09:52:39 2012] [notice] Child 3104: All worker threads have exited.
[Sat Mar 17 09:52:39 2012] [notice] Child 5368: Starting thread to listen on port 80.
[Sat Mar 17 09:52:39 2012] [notice] Child 3104: Child process is exiting
你先装我说的版本吧,然后修改php.ini文件将php的错误提示打开.如果是空白 多数可能问题出在php.你的phpinfo能显示的话就应该是apache+php正常了。
但是你现在的php.ini不知道乱成啥了,你先装个好的,然后再来干活
另外装之前把windows下的php.ini也删除了
由于 可以访问phpinfo的那个函数的php页面,表示配置基本正常
其他页面返回空页面 是因为程序有错,却又没打开错误显示功能造成的第二种方式:(cgi方式)
需要 php.ini 中
cgi.force_redirect = 1