环境是
apache2.2
PHP5.4
在apache的安装目录下的htdosc是我的WEB根目录.
我在里面创建的项目不能解析PHP文件.会提示连接被重置!或网络已断开.在地址栏输入这个路径只能看到当前目录下的文件.
而根目录的index.php却能正常解析.有时候自己就好了.很奇怪啊.
我觉得是httpd.conf的配置有问题.看了又找不出原因.我对apache的配置不是很懂.
请各位哥哥帮帮我.
apache2.2
PHP5.4
在apache的安装目录下的htdosc是我的WEB根目录.
我在里面创建的项目不能解析PHP文件.会提示连接被重置!或网络已断开.在地址栏输入这个路径只能看到当前目录下的文件.
而根目录的index.php却能正常解析.有时候自己就好了.很奇怪啊.
我觉得是httpd.conf的配置有问题.看了又找不出原因.我对apache的配置不是很懂.
请各位哥哥帮帮我.
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php .phtml .vcgi
AddHandler type-map var
</IfModule>
WAMP-windows_apache_mysql_php相关配置及搭建环境
根目录的.php文件就可以解析.到了子目录就不能解析了.如果子目录没有index.php那么浏览器就会列出所有子目录下的文件.如果有这个index.php,浏览器提示连接被重置,连接断开.
动态文件,例如php放cgi-bin里
google关键字:Apache ScriptAlias
DefaultType text/plain<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
#
TypesConfig conf/mime.types #
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3 #
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi # For type maps (negotiated resources):
#AddHandler type-map var #
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
</IfModule>
如果是apache的默认配置,就有关系,看一下apache默认ScriptAlias就知道了当然如果LZ已经成功、正确修改了apache的配置,那我想就不会遇到顶楼所说的问题了....
而根目录的index.php却能正常解析.如果没有index.php索引文件,你直接打开目录的话 的确是显示文件目录结构的,如果有这个index.php文档,那么apache会先解析index.php文档.这个你可以在apache的配置文件修改 搜索
Options Indexes FollowSymLinks将Indexes 去掉 保存重启apache 即可.访问某个文件提示 连接被重置
那就查日志看看具体的错误是什么内容 .这种原因可能有很多,比如你的php出现错误 .打开 php.ini里的错误提示,设置浏览器的(IE的友好错误提示)...
后来解决了.
解决方法很简单.我又重新下载了一个apache. 安装配置后,一切正常了.