nfig.h'': No such file or directory
拥有帝国一切,皆有可能。欢迎访问phome.net
make: *** [install-headers] Error 1
重新创建目录
mkdir -p /usr/local/jpeg/include 问题解决
2)编译安装libpng
tar zxvf libpng-1.2.12.tar.gz
cd libpng-1.2.12
./configure
make && make install
3)编译freetype
tar zxvf freetype-2.2.1.tar.gz
cd freetype-2.2.1
./configure --prefix=/usr/local/freetype
4)编译GD库
tar -zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-png=/usr/local/lib/ --with-freetype=/usr/local/freetype/
make && make install
5)安装编译PHP
解压 tar zxvf php-5.3.6.tar.gz
cd php-5.3.6
开始编译
[root@localhost php-5.3.6]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql-dir=/usr/local/mysql/ --with-gd=/usr/local/gd2/ --with-png --with-jpeg-dir=/usr/local/jpeg6/ --with-zlib-dir=/usr/lib --with-freetype-dir=/usr/local/freetype/
--prefix是安装目录.--with-config-file-path是指定php配置文档php.ini所在的目录.--with-mysql,安装mysql扩展.--with-zlib安装zlib扩展,前提是linux已经安装了zlib,未安装可以去掉这个选项. 安装mbstring和xml扩展.这些都是常用的模块.
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore.
编译时出现这个问题,刚开始被误导了,这样做,没解决问题,出现另一个错误
configure: error: mysql configure failed. Please check config.log for more information.
,找到解决方法,实际上是--with-mysql选项有误,应该为--with-config-dir=/usr/local/mysql
OK
configure fails with:
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
拥有帝国一切,皆有可能。欢迎访问phome.net
checking for MySQL UNIX socket location... no
configure: error: Cannot find libmysqlclient under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!
解决方法:
This fixes the problem:
cd /usr/local/mysql
ln -s lib lib64
复制php.ini文件
cp php.ini-production /usr/local/lib
重命名 mv php.ini-production php.ini
php编译完成
5配置apache与PHP的关联
编辑文件:vi /var/www/html/test.php
<?php
phpinfo();
?>
在浏览器中打开 http://localhost/test.php 可以看到安装的PHP的一些信息,及其他服务的相应模块
本文出自 “JOE011” 博客,请务必保留此出处http://joe011.blog.51cto.com/3538628/661811
拥有帝国一切,皆有可能。欢迎访问phome.net |