免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 4758 | 回复: 12
打印 上一主题 下一主题

[Web] [求救]apache不支持PHP,查了网上资料,不知道怎么解决啦 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-28 00:02 |只看该作者 |倒序浏览
系统:AS4
APACHE版本:2.2.8
PHP版本:5.2.6

apache的安装过程为:
./configure --enable-modules=so --enable-rewrite
make;make install

。。。
安装gd
。。。

安装php的过程为:
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/env/mysql/ --with-libxml-dir=/usr/local/libxml2 --with-expat-dir=/usr/lib --with-xsl=/usr/local/libxslt --enable-xslt --with-gd=/usr/local/gd2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-zlib-dir=/usr/lib --with-png --with-freetype-dir=/usr/local/freetype --enable-mbstring
make;make install
cp php.ini-recommended /usr/local/php5/lib/php.ini

添加如下两行到http.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

重启apache,发现不能支持php

上网查了,别人说的我也做了,还是不能支持,在这里请教一下大家。

论坛徽章:
1
IT运维版块每日发帖之星
日期:2015-09-29 06:20:00
2 [报告]
发表于 2008-05-28 09:56 |只看该作者
启动apache或者访问php的时候,是否报错
把错误log贴出来看看

论坛徽章:
0
3 [报告]
发表于 2008-05-28 10:25 |只看该作者
没有任何错误,IE直接访问index.php也可以访问得到,只是里面的php代码好像没有被执行到
可以访问这个看效果http://www.niugu800.com:8080/index.php

论坛徽章:
1
IT运维版块每日发帖之星
日期:2015-09-29 06:20:00
4 [报告]
发表于 2008-05-28 12:41 |只看该作者
什么代码没有执行到?
我看好像是css首先没有执行,先解决css和图片问题

论坛徽章:
0
5 [报告]
发表于 2008-05-28 16:02 |只看该作者
直接访问css或图片是可以访问得到的
现在的问题就是php文件中的php代码没有被执行,比如这么一个php文件:test.php
<?
echo "here";
?>
123456

从IE访问的结果是123456,here没有被打印出来,也就是php代码没有被执行。。。

论坛徽章:
0
6 [报告]
发表于 2008-05-29 11:52 |只看该作者
apachectl -t -D DUMP_MODULES
看看你的php模块加载了没有

论坛徽章:
0
7 [报告]
发表于 2008-05-29 14:33 |只看该作者
应该加载了的

Loaded Modules:
core_module (static)
authn_file_module (static)
authn_default_module (static)
authz_host_module (static)
authz_groupfile_module (static)
authz_user_module (static)
authz_default_module (static)
auth_basic_module (static)
include_module (static)
filter_module (static)
log_config_module (static)
env_module (static)
setenvif_module (static)
mpm_prefork_module (static)
http_module (static)
mime_module (static)
status_module (static)
autoindex_module (static)
asis_module (static)
cgi_module (static)
negotiation_module (static)
dir_module (static)
actions_module (static)
userdir_module (static)
alias_module (static)
rewrite_module (static)
so_module (static)
php5_module (shared)
Syntax OK

论坛徽章:
0
8 [报告]
发表于 2008-05-29 15:53 |只看该作者
你的php支持
<?
?>
模式,看看你的php.ini的配置吧

论坛徽章:
4
IT运维版块每日发帖之星
日期:2015-09-01 06:20:00IT运维版块每日发帖之星
日期:2015-10-09 06:20:00操作系统版块每日发帖之星
日期:2015-10-20 06:20:00IT运维版块每日发帖之星
日期:2015-11-03 06:20:00
9 [报告]
发表于 2008-05-29 22:03 |只看该作者
apache的安装过程为:
./configure --enable-modules=so --enable-rewrite
make;make install


安装php的过程为:
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs
你都没有指定apache的路径,默认的路径不是在/usr/local/apache2, 你在安装apache时没有prefix=/usr/local/apache2    而在安装php时指定了.其它配置都很简单啊

论坛徽章:
4
IT运维版块每日发帖之星
日期:2015-09-01 06:20:00IT运维版块每日发帖之星
日期:2015-10-09 06:20:00操作系统版块每日发帖之星
日期:2015-10-20 06:20:00IT运维版块每日发帖之星
日期:2015-11-03 06:20:00
10 [报告]
发表于 2008-05-29 22:06 |只看该作者
./configure --prefix=/usr/local/apache2 \
--enable=so
make
make install
/usr/local/apache2/bin/apachectl start

安装php
./configure --with-apxs2=/usr/local/apache2/bin/apxs     

其它参数自己加,在安装apache时没指定路径,而在安装php 时却指定了apache的路径.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP