免费注册 查看新帖 |

Chinaunix

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

请教关于PHP安装的问题! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-03-04 20:42 |只看该作者 |倒序浏览
大家好!我再linux环境下安装mysql+apache+php的组合!当安装PHP的时候:
[root@weiming root]#cd /usr/local/
  [root@weiming local]# tar -zxvf php-5.2.8.tar.gz
  [root@weiming local]# cd php-5.2.8
  [root@weiming php-5.2.8]# ./configure --prefix=/usr/local/php4 --with-apxs2=/usr/local/apache/bin/apxs --with-

  mysql=/usr/local/mysql

      #make
#make install
#cp php.ini-dist /usr/local/lib/php.ini
#vi /usr/local/apache2/conf/httpd.conf
就是这步的问题:
网上的资料说是:DirectoryIndex index.html
在后面加入 index.php 让apache也能打开默认首页为php的文件。
查找:
#AddType application/x-tar .tgz
在下面加入
AddType application/x-httpd-php .php

重启apache


第一个DirectoryIndex index.html
找到啦而且也添加啦!但是#AddType application/x-tar .tgz
没有找到只找到了:#AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz和
   AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
   这两项我在下面添加AddType application/x-httpd-php .php

出去重启APACHE:
[root@localhost httpd]# /usr/local/apache/bin/apachectl start
Syntax error on line 310 of /etc/httpd/httpd.conf:
AddType requires at least two arguments, a mime type followed by one or more file extensions
这是怎么回事??高手给下解答??

论坛徽章:
0
2 [报告]
发表于 2009-03-05 13:12 |只看该作者
在第310行查找下错误。

论坛徽章:
0
3 [报告]
发表于 2009-03-05 15:19 |只看该作者
310行就是这两句啊!!AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
我加上AddType application/x-httpd-php.php才显示出错的啊!!

论坛徽章:
0
4 [报告]
发表于 2009-03-05 18:05 |只看该作者
找到AddType
添加AddType application/x-httpd-php .php4

论坛徽章:
0
5 [报告]
发表于 2009-03-06 12:36 |只看该作者
不是吧!我试试!!怎么可能是php4?应该是Add application/x-httpd-php.php5吧?

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
6 [报告]
发表于 2009-03-06 14:19 |只看该作者
AddType application/x-httpd-php .php
就行,注意httpd-php .php之间有空格

论坛徽章:
0
7 [报告]
发表于 2009-03-06 14:29 |只看该作者
你用系统自带的AMP不行吗?干嘛非要编译呢?

论坛徽章:
0
8 [报告]
发表于 2009-03-06 14:34 |只看该作者
复制这两行代替你的试一下
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP