PHP文件不能解析
答案:2 悬赏:70
解决时间 2021-02-21 01:40
- 提问者网友:wodetian
- 2021-02-20 12:44
PHP和Apache配置后,输入localhost提示下载。去掉:AddType application/x-httpd-php .php .html .htm 后,PHP解析为源码。这是怎么回事?
最佳答案
- 二级知识专家网友:承载所有颓废
- 2021-02-20 14:13
AddType application/x-httpd-php .php .html .htm这一行是配置Apache支持文件类型的,你把它删掉后,Apache就不知按照何种解码方式了。
全部回答
- 1楼网友:一只傻青衣
- 2021-02-20 14:22
html文件能访问说明web服务器是正常运行的,这个问题是由于你的apache服务器的脚本解释器没有配置好,
loadmodule "php静态库名.so"
找到
#在此标签末尾加上php的路径映射
scriptalias /cgi-bin/ "...../apache software foundation/apache2.2/cgi-bin/"
scriptalias /php/ "....../php-5.2.6-win32/"
#
# typesconfig points to the file containing the list of mappings from
# filename extension to mime-type.
#
.
.
.
#在下面加入mime类型,服务器根据mime类型来调用想用的脚本解释器
addtype application/x-compress .z
addtype application/x-gzip .gz .tgz
addtype application/x-httpd-php .php
#addhandler php5-script php, 我这里用的是windows
action application/x-httpd-php "/php/php-cgi.exe"
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯