Home > Backend Development > PHP Tutorial > PHP装配和配置

PHP装配和配置

WBOY
Release: 2016-06-13 12:37:03
Original
954 people have browsed it

PHP安装和配置

编译安装php5-5.2.6-49.11.src.rpm:
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/lib
make;make install
OK,现在已经完成50%了,下来就是修改httpd.conf和php.ini文件了
首先我们用命令:
cp /etc/php5/cli/php.ini /usr/local/lib/php.ini
vi /usr/local/lib/php.ini
修改下面的内容为On
register-golbals = On

添加extension=mysql.so (访问Mysql)
然后修改httpd.conf文件
vi /usr/local/apache/conf/httpd.conf
修改为下面的内容:
#将ServerAdmin q3boy@younet.com一行改为您的邮箱地址 
#DocumentRoot "/home/httpd/html/" 此处为html文件主目录 
# 同上 
#Options FollowSymLinks MultiViews 为安全起见,去掉"Indexes" 
# 
# DirectoryIndex default.php default.phtml default.php3 default.html default.htm 
# 
#设置apache的默认文件名次序 
AddType application/x-httpd-php .php .phtml .php3 .inc 
AddType application/x-httpd-php-source .php
#设置php文件后缀 
OK!现在已经完成98%了,下面启动apache服务
/usr/local/apache/bin/apachectl start
自己制作一个test.php文件放到主目录中测试apache

  phpinfo();
?>
看到了吧! 如果成功的话,会显示你的phpinfo界面。

 

问题1:安装php的configure出错,提示找不到xmllib之类。解决办法:安装libxml2-2.7.1-8.6.src.rpm

问题2:访问http://127.0.0.1/index.php, 提示"Your PHP installation appears to be missing the MySQL extension which is required by WordPress." 解决办法:安装php5-mysql-5.2.6-52.8.i586.rpm及其prerequired package: php5-pdo-5.2.6-49.11.i586.rpm;修改php.ini,添加extension=mysql.so。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template