QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 789|回复: 4

apache不能解释php

[复制链接]
发表于 2003-10-22 13:53:22 | 显示全部楼层 |阅读模式
已经安装了php,MYSQL,
apache曾经是可以运行php的,
但现在在web中浏览php文件的时候,
总是提示要将php页面下载下来。

我尝试过在httpd.conf加入php模块:
LoadModule php_module        modules/mod_php.so
LoadModule php3_module       modules/mod_php3.so
LoadModule perl_module       modules/mod_perl.so

AddModule mod_php.c
AddModule mod_php3.c
AddModule mod_perl.c
但restart的httpd的时候出错

我也尝试过加入:
AddType application/x-httpd-php .php
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php-source .phps

但还是不行,apache还是不可以解释php
请问什么原因?
谢谢。
发表于 2003-10-22 17:11:53 | 显示全部楼层
看看apache的日志
回复

使用道具 举报

 楼主| 发表于 2003-10-23 10:13:20 | 显示全部楼层
I have resolved this problem.
Since apache can't run php, it means apache can't realize that when i request a php file, it should hand it over to the php engine to parse the file. As a result, it just to send the file i requested.
Here are what i done(in httpd.conf):

1) Load php module, add "LoadModule php4_module /usr/local/apache/libexec/libphp4.so". Obviously, libphp4.so must exists in the libexec directory;
2) Add php module. add this directive: "AddModule php4_module.c";
3) Add file type:
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php3 .php3
    AddType application/x-httpd-php-source .phps
4) restart apache server:
    /etc/rc.d/init.d/httpd restart
回复

使用道具 举报

发表于 2004-1-9 12:49:10 | 显示全部楼层
[quote:65c8726331="barble"]I have resolved this problem.
Since apache can't run php, it means apache can't realize that when i request a php file, it should hand it over to the php engine to parse the file. As a result, it just to send the file i requested.
Here are what i done(in httpd.conf):

1) Load php module, add "LoadModule php4_module /usr/local/apache/libexec/libphp4.so". Obviously, libphp4.so must exists in the libexec directory;
2) Add php module. add this directive: "AddModule php4_module.c";
3) Add file type:
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php3 .php3
    AddType application/x-httpd-php-source .phps
4) restart apache server:
    /etc/rc.d/init.d/httpd restart[/quote]


AddModule php4_module.c我插入这段话后.重启出错啊
回复

使用道具 举报

发表于 2004-1-9 13:06:00 | 显示全部楼层
出的什么错 ??
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-15 06:30 , Processed in 0.038756 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表