php+apache2部署--可以访问txt但是fastcgi的php却403访问不了??

yangzhijiang675 2012-03-16 10:18:01
java比较熟悉、php写过helloworld而已、 部署方面是弱项!!! (帮人家修改项目、代码用的是php)
httpd测试说配置正常!! httpd.exe \t
手动查我的几个目录都好像权限正常:包括web跟文件夹目录、php安装目录和可执行文件、apache2.2的文件夹权限好像也正常;

##第一种情况,服务器已经启动;
##可以访问txt和html,但是访问不了php,提示403;
##httpd.conf的配置如下:
# install php handler
LoadModule php5_module "E:/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html

ServerRoot "E:/Program Filesn/Apache2.2"
Listen 10086
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 yangzhijiang675@gmail.com
DocumentRoot "G:/etone_www"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
</Directory>
<Directory "G:/etone_www">
Options Indexes FollowSymLinks ExecCGI Includes
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>
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>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>


##第二种情况使用handler、这个比较诡异:服务器已经启动:
##php可以访问helloworld、txt也可以访问 、但是我真正要访问的“大多数php文件”都好像没经过这个handler的处理;
##logs\errors.log也没记录是什么问题;

# install php handler
#LoadModule php5_module "E:/PHP/php5apache2_2.dll"
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php .html


# install php fastcgi 我已经复制和下载到apache的modules文件夹
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 10086
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 yangzhijiang675@gmail.com
DocumentRoot "G:/etone_www"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
</Directory>
<Directory "G:/etone_www">
Options Indexes FollowSymLinks ExecCGI Includes
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>
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>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
谢谢啊
...全文
143 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangzhijiang675 2012-03-17
  • 打赏
  • 举报
回复
http://user.qzone.qq.com/191103619/photo/V14EpYgd2AM7er/

##httpd配置如下

# 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 yangzhijiang675@gmail.com
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>
yangzhijiang675 2012-03-17
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 phpnewnew 的回复:]

php 版本告诉我.
[/Quote]

#####第一种情况如下:使用handler在apache2.2 ,php是5.2.17,
####可以访问php页面,但是其他php好像很莫名其妙访问不了
###截图如下
yangzhijiang675 2012-03-17
  • 打赏
  • 举报
回复
###php PHP 5.2.17版本 E:\php
##apache 2.2 E:\Program Filesn\Apache2.2
##上面的不用看了,下面我重新发
黄袍披身 2012-03-16
  • 打赏
  • 举报
回复
php 版本告诉我.
yangzhijiang675 2012-03-16
  • 打赏
  • 举报
回复
顺便问下php+eclipse 是不是用xdebug调试web服务器的?? 大概需要什么工具? 免得我找的辛苦??

谢谢

yangzhijiang675 2012-03-16
  • 打赏
  • 举报
回复
##第二种情况:::handler那个helloword可以被编译、但是其他php就莫名其妙的没有得到我要的结果; 好郁闷

文件夹权限都设置了、觉得ok啊 、就是可以访问helloworld,其他php不可以!! 郁闷
yangzhijiang675 2012-03-16
  • 打赏
  • 举报
回复
现在我郁闷的是怎么调试、我压根不知道我的代码

如何被运行!!!

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧