rhel4 x86_64 php5.2.17 make安装 支持mysqli
2011-12-26 20:38
639 查看
1, 下载 php-5.2.17.tar.gz到~/download,
2, 解压
tar -zxvf php-5.2.17.tar.gz
cd php-5.2.17
2, configure, 指定安装路径 (/usr/local/php5.2.17)
./configure --prefix=/usr/local/php5.2.17/ --with-mysql=/usr/local/mysql --with-apxs2=/usr/sbin/apxs --enable-mbstring --with-libxml --with-freetype-dir --with-png-dir --with-jpeg-dir --with-zlib-dir --with-ttf --enable-gd-native-ttf --with-gd --with-gettext
注:
a, 最好指定安装路径,方便卸载(直接删除该目录), 默认装在/usr/local
b, --with-apxs2指定apxs文件的具体目录(可用which apxs查找)
c, --enable-mbstring 多字节编码支持
d, --with-libxml 使用xml
e, --with-freetype-dir --with-png-dir --with-jpeg-dir --with-zlib-dir --with-ttf --enable-gd-native-ttf --with-gd为生成验证图片所必须, 注意--with-gd应放在最后, 有--with-gdt选项其它的才起作用.
f, 在x86_64上会提示找不到libjpeg.so, libpng.so, 因为 这两个文件在/usr/lib64下。 解决办法: 创建符号链接到/usr/lib
ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so
ln -s /usr/lib64/libpng.so /usr/lib/libpng.so
g, 使用--with-config-file-path=[php安装目录] 可以指定php.ini应放在哪个目录,默认在--prefix指定目录的子目录lib下。可以在httpd.conf中用:PHPIniDir [php.ini所在目录] 明确指示
3, 编译并安装
make && make install
4, 追加编译安装mysqli (直接--with-mysqli=/usr/local/mysql/bin/mysql_config安装会出错: Undefined symbol: .mysql_set_server_option)
cd ext/mysqli/
/usr/local/php5.2.17/bin/phpize
./configure --prefix=/usr/local/php5.2.17 --with-php-config=/usr/local/php5.2.17/bin/php-config --enable-embedded-mysqli=shared --with-ysqli=/usr/local/mysql/bin/mysql_config --enable-shared
make
make install
成功后会提示安装到哪个目录(如: /usr/local/php5.2.17/lib/php/extensions/no-debug-non-zts-20060613/)
将mysqli.so拷贝到php的lib目录
cp /usr/local/php5.2.17/lib/php/extensions/no-debug-non-zts-20060613/mysqli.so /usr/local/php5.2.17/lib/
配置php.ini
vi /usr/local/php5.2.17/lib/php.ini
指定extension_dir和extension, 最后用绝对路径(相对路径不知当前路径指的是哪~o~)如:
extension_dir = "/usr/local/lib"
extension=mysqli.so
注: 也可用此方法来追加安装其它模块,形 如:
[php安装目录]/bin/phpize
./configure --with-php-config=[php安装目录]/bin/php-config --with-mbstring
make
make install
5, 重启apache服务
service httpd restart
2, 解压
tar -zxvf php-5.2.17.tar.gz
cd php-5.2.17
2, configure, 指定安装路径 (/usr/local/php5.2.17)
./configure --prefix=/usr/local/php5.2.17/ --with-mysql=/usr/local/mysql --with-apxs2=/usr/sbin/apxs --enable-mbstring --with-libxml --with-freetype-dir --with-png-dir --with-jpeg-dir --with-zlib-dir --with-ttf --enable-gd-native-ttf --with-gd --with-gettext
注:
a, 最好指定安装路径,方便卸载(直接删除该目录), 默认装在/usr/local
b, --with-apxs2指定apxs文件的具体目录(可用which apxs查找)
c, --enable-mbstring 多字节编码支持
d, --with-libxml 使用xml
e, --with-freetype-dir --with-png-dir --with-jpeg-dir --with-zlib-dir --with-ttf --enable-gd-native-ttf --with-gd为生成验证图片所必须, 注意--with-gd应放在最后, 有--with-gdt选项其它的才起作用.
f, 在x86_64上会提示找不到libjpeg.so, libpng.so, 因为 这两个文件在/usr/lib64下。 解决办法: 创建符号链接到/usr/lib
ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so
ln -s /usr/lib64/libpng.so /usr/lib/libpng.so
g, 使用--with-config-file-path=[php安装目录] 可以指定php.ini应放在哪个目录,默认在--prefix指定目录的子目录lib下。可以在httpd.conf中用:PHPIniDir [php.ini所在目录] 明确指示
3, 编译并安装
make && make install
4, 追加编译安装mysqli (直接--with-mysqli=/usr/local/mysql/bin/mysql_config安装会出错: Undefined symbol: .mysql_set_server_option)
cd ext/mysqli/
/usr/local/php5.2.17/bin/phpize
./configure --prefix=/usr/local/php5.2.17 --with-php-config=/usr/local/php5.2.17/bin/php-config --enable-embedded-mysqli=shared --with-ysqli=/usr/local/mysql/bin/mysql_config --enable-shared
make
make install
成功后会提示安装到哪个目录(如: /usr/local/php5.2.17/lib/php/extensions/no-debug-non-zts-20060613/)
将mysqli.so拷贝到php的lib目录
cp /usr/local/php5.2.17/lib/php/extensions/no-debug-non-zts-20060613/mysqli.so /usr/local/php5.2.17/lib/
配置php.ini
vi /usr/local/php5.2.17/lib/php.ini
指定extension_dir和extension, 最后用绝对路径(相对路径不知当前路径指的是哪~o~)如:
extension_dir = "/usr/local/lib"
extension=mysqli.so
注: 也可用此方法来追加安装其它模块,形 如:
[php安装目录]/bin/phpize
./configure --with-php-config=[php安装目录]/bin/php-config --with-mbstring
make
make install
5, 重启apache服务
service httpd restart
相关文章推荐
- RHEL6.3_x86_64 下源码安装Apache(2.2.5)MySQL(5.5.25a) PHP(5.2.17)
- RHEL5.4-x86_64 + PHP5.3.2 + APACHE2.2.15 + MYSQL5.1.46 安装
- php5.2.17安装libpng时报zlib的错误:libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not
- 如何在Centos 6 X86_64安装RHEL EPEL知识库?
- RHEL5.8安装Sybase 15.7_x86_64
- RHEL5.4 安装nginx-1.0 + php-5.2.17(fastcgi)+mysql-5.1.40 推荐
- rhel-server-6.3-x86_64-dvd.iso 安装gcc,g++
- Linux.5.6].rhel-server-5.6-x86_64下安装GCC的方法
- yum php56w_x86_64 后的 php-mysql 安装问题报错问题
- mac 安装PHP提示“ld: symbol(s) not found for architecture x86_64”
- RHEL4.4-x86_64 + Oracle 10.2.0.1安装笔记
- RHEL 6.2 x86_64 下安装Oracle 11g步骤
- 在rhel6.3 x86-64系统上安装lsscsi包
- RHEL6.3_x86_64平台安装11.2.0.3 64-bit (x86-64)
- RHEL 6.4 x86_64 更换自带yum并安装配置163 yum源
- RHEL5 X86-64上安装Oracle 11gR2示例与总结
- RHEL5 Oracle10g(10.2.0.1) x86_64 安装步骤
- rhel6.4 x86_64 安装oracle 11g R2
- 在 RHEL5 或 OL5 64 位 (x86-64) 上安装 Oracle Database 12.1 的要求
- Oracle10gR2 On RHEL5 x86_64安装技术文档(原版英文)