Chinaunix

标题: 请教关于PHP安装的问题! [打印本页]

作者: ly_lee    时间: 2009-03-04 20:42
标题: 请教关于PHP安装的问题!
大家好!我再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
这是怎么回事??高手给下解答??
作者: 只爱睡觉    时间: 2009-03-05 13:12
在第310行查找下错误。
作者: ly_lee    时间: 2009-03-05 15:19
310行就是这两句啊!!AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
我加上AddType application/x-httpd-php.php才显示出错的啊!!
作者: 只爱睡觉    时间: 2009-03-05 18:05
找到AddType
添加AddType application/x-httpd-php .php4
作者: ly_lee    时间: 2009-03-06 12:36
不是吧!我试试!!怎么可能是php4?应该是Add application/x-httpd-php.php5吧?
作者: chenyx    时间: 2009-03-06 14:19
AddType application/x-httpd-php .php
就行,注意httpd-php .php之间有空格
作者: jerrywjl    时间: 2009-03-06 14:29
你用系统自带的AMP不行吗?干嘛非要编译呢?
作者: 我是DBA    时间: 2009-03-06 14:34
复制这两行代替你的试一下
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2