2013年11月22日 11:25:41
Linux centos 6.3 最小化安装
mysql 5.5
php 5.4
安装PHP时只是 ./configure --prefix=/****
并没有其它的设置,随后又去安装的其它扩展(纯属瞎折腾,学习怎么用Linux)
在安装mysql和mysqli的扩展时的命令还不一样
生成mysql.so
cd php-5.4./include/ext #源码解压包的扩展目录
cd mysql #进入mysql扩展
/usr/local/lamp/php54/bin/phpize
./configure --with-php-config=/usr/local/lamp/php54/bin/php-config --with-mysql=/usr/local/lamp/mysql
make && make install
生成msyqli.so
和生成msyql.so的步骤中前三步是一模一样的,不同的是第四步:
./configure --with-php-config=/usr/local/lamp/php54/bin/php-config --with-mysqli=/usr/local/lamp/mysql/bin/mysql_config
否则会报警告:
You will need re2c 0.13. or later if you want to regenerate PHP parsers
然后再 make && make install 就可以生成mysqli.so了
但是,不是说PHP5.4已经默认有mysqlnd了么,为什么这里还得指定mysql的安装目录才能生成mysql扩展?
./configure --help --with-mysql=DIR Include MySQL support. DIR is the MySQL base
directory, if no DIR is passed or the value is
mysqlnd the MySQL native driver will be used --with-mysqli=FILE Include MySQLi support. FILE is the path
to mysql_config. If no value or mysqlnd is passed
as FILE, the MySQL native driver will be used
配置命令:
./configure --prefix=**** --enable-mysqlnd --with-mysql --with-mysqli
如果之前编译(make)失败,记得用make clean 或者 make distclean 清除之前编译的缓存文件,然后再重新make && make install
----------------------------
安装 re2c ,语法分析器,编译PHP时用到
wget http://jaist.dl.sourceforge.net/project/re2c/re2c/0.13.6/re2c-0.13.6.tar.gz
------------------------------------
PHP的配置文件在解压后的源码包里
如果安装的时候指定了配置文件的安装路径,安装程序就会将配置文件.....(稍后再叙)
--with-config-file-path=PATH
Set the path in which to look for php.ini [PREFIX/lib]