(apache的安装目录必须填写正确,以上节讲的为例--with- apxs2=/usr/local/jttpd/bin/apxs。
出现的错误&解决方法 情况1、configure: error: libjpeg.(a|so) not found
yum install libjpeg-devel
ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so (64位系统需操作,在/usr下 有lib和lib64两个文件夹,安装libjpeg-devel后,libjpeg.so默认在lib64中,需要 复制到lib)
情况2、configure: error: libpng.(a|so) not found.
yum install libpng-devel
ln -s /usr/lib64/libpng.so /usr/lib/libpng.so
情况3、configure: error: freetype.h not found.
ln -s /usr/lib64/libpng.so /usr/lib/libpng.so
情况4、configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
yum install mysql-devel
ln -s /usr/lib64/mysql/libmysqlclient.so.15.0.0
情况5、configure: error: Cannot find libtidy
yum install libtidy-devel
yum install libtidy
以上情况均有可能出现,每次解决一种情况就重新运行一次./configure --with- apxs2=apache的安装目录(/usr/local/httpd)/bin/apxs --with-mysql --with- gd
直到提示成功!
编译&安装 make&&make install
cp php.ini-dist /usr/local/php.ini(必须是配置编译参时php.ini指定的路径)
出现的错误情况:
Wrote PEAR system config file at: /usr/local/php5/etc/pear.conf
You may want to add: /usr/local/php5/lib/php to your php.ini include_path
Installing PDO headers:
解决方法:
1、查看
# vi /usr/local/apache2/conf/httpd.conf
LoadModule php5_module modules/libphp5.so
这是自动加入对php模块支持
2、添加默认的文件格式
# vi /usr/local/httpd/conf/httpd.conf
找到 AddType application/x-gzip .gz .tgz 在其下添加如下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
3、添加默认的首页
DirectoryIndex index.html index.htm index.php
4、保存
重启apache cd /usr/local/httpd/bin
./apachectl restart
测试 自己编写index.php文件,放到/usr/local/httpd/htdocs下