无标题文档
wdCP系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdCDN系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
wdOS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdDNS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
注册 发贴 提问 回复-必看必看 wddns免费智能 DNS 开通 本地或虚拟机使 用wdcp 一键包在mysql编 译时"卡住"
【300G高防】双线 无视攻击 wdcp官方技术支持/服务 阿里云8折优惠券 无敌云 腾讯云优惠中,现注册更有260代金额券赠送
返回列表 发帖
提问三步曲: 提问先看教程/FAQ索引(wdcp,wdcp_v3,一键包)及搜索,会让你更快解决问题
1 提供详细,如系统版本,wdcp版本,软件版本等及错误的详细信息,贴上论坛或截图发论坛
2 做过哪些操作或改动设置等

温馨提示:信息不详,很可能会没人理你!论坛有教程说明的,也可能没人理!因为,你懂的

[教程] 增加mysqli 扩展 的安裝

假如你是用lanmp.tar.gz安装的
cd lanmp/php-5.2.17
可以通过phpinfo来查看原本php的编译参数,如下
./configure --prefix=/www/wdlinux/php-5.2.17 --with-config-file-path=/www/wdlinux/etc --with-fpm-conf=/www/wdlinux/etc/php-fpm.conf --with-mysql=/www/wdlinux/mysql --with-iconv-dir=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp --with-apxs2=/www/wdlinux/apache/bin/apxs

在最后增加 --with-mysqli=/www/wdlinux/mysql/bin/mysql_config

全部如下
./configure --prefix=/www/wdlinux/php-5.2.17 --with-config-file-path=/www/wdlinux/etc --with-fpm-conf=/www/wdlinux/etc/php-fpm.conf --with-mysql=/www/wdlinux/mysql --with-iconv-dir=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp --with-apxs2=/www/wdlinux/apache/bin/apxs --with-mysqli=/www/wdlinux/mysql/bin/mysql_config
然后
make;make install

编译完,重起下httpd就可以了,如
service httpd restart

完成
以上是对apache的,如果是nginx,方法一样,只是把apache相关的替换为nginx即可

也单独下载php-5.2.17.tar.gz文件进行编译

本帖最后由 hyxuzhimin 于 2012-1-16 14:32 编辑

我需要装pdo_mysql.so 扩展是不是也重新编译这么装?
--with_pdo_mysql  ??
这是我lanmp.sh文件里找到的
325:    ./configure --prefix=$IN_DIR/php-5.2.17 --with-config-file-path=$IN_DIR/etc --with-mysql=$IN_DIR/mysql --with-iconv=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp $NV
请问是在这里添加--with_pdo_mysql  来安装pdo_mysql.so 扩展吗?

TOP

请问为什么我添加之后 configure,提示
configure: error: --with_pdo_mysql: invalid option; use --help to show usage

TOP

参数错误,应该是--with-pdo-mysql
看清提问三步曲及多看教程/FAQ索引(wdcp,v3,一键包,wdOS),益处多多.wdcp工具集 阿里云主机8折优惠码

TOP

为什么编译完后phpinfo()函数不能用了呢?

TOP

本帖最后由 hyxuzhimin 于 2012-1-25 21:03 编辑

回复 4# admin
很奇怪 只加--with-pdo-mysql然后configure会提示找不到mysql的header。有--with-mysql=/www/wdlinux/mysql-5.1.56 也不行。而mysql.h在这个路径里。
但是改成 --with-pdo-mysql=/www/wdlinux/mysql-5.1.56/bin/mysql_config    , configure就成功了。

TOP

改成这样就成功了。
./configure --prefix=/www/wdlinux/php-5.2.17 --with-config-file-path=/www/wdlinux/etc  --with-mysql=/www/wdlinux/mysql-5.1.56  --with-pdo-mysql=/www/wdlinux/mysql-5.1.56/bin/mysql_config  --with-iconv=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp

TOP

很奇怪用上面的configure参数可以make make install,但phpinfo()里依然没有pdo-mysql,而且参数里也没--with-pdo-mysql=/www/wdlinux/mysql-5.1.56/bin/mysql_config
pdo.jpg
2012-1-25 21:52

configure.jpg
2012-1-25 21:52

TOP

请问单独编译pdo_mysql为啥也不行?
我是通过这个教程装的 http://www.cnblogs.com/DavidYan/articles/2149647.html
使用了lanmp压缩包里的PDO_MYSQL-1.0.2.tgz
tar xzf  PDO_MYSQL-1.0.2.tgz
cd  PDO_MYSQL-1.0.2
/www/wdlinux/php-5.2.17/bin/phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
./configure --with-php-config=/www/wdlinux/php-5.2.17/bin/php-config --with-pdo-mysql=/www/wdlinux/mysql
顺利安装,并修改了vi /www/wdlinux/etc/php.ini
extension=pdo_mysql.so
我find一下pdo_mysql.so已经放在php/extensions/debug-non-zts-20060613/pdo_mysql.so文件夹了
重启httpd
但是phpinfo里还是没有pdo_mysql,Drupal安装也没有找到mysql,只有sqlite.
请问这是怎么回事呢?

TOP

./configure --prefix=/www/wdlinux/php-5.2.17 --with-config-file-path=/www/wdlinux/etc  --with-mysql=/www/wdlinux/mysql  --enable-pdo  --with-pdo-mysql=/www/wdlinux/mysql  --with-iconv=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp 重新改了参数make install 成功还是不能在phpinfo里看到pdo_mysql,drupal7也找不到mysql,只有sqlite。求助大虾了。因为上面两种安装现在都顺利了,但是还是开启不了pdo_mysql

TOP

重起一下apache
看清提问三步曲及多看教程/FAQ索引(wdcp,v3,一键包,wdOS),益处多多.wdcp工具集 阿里云主机8折优惠码

TOP

/tmp/lanmp/php-5.2.17/ext/standard/info.c:68: undefined reference to `ts_resource_ex'
ext/standard/.libs/info.o: In function `php_print_info':
/tmp/lanmp/php-5.2.17/ext/standard/info.c:743: undefined reference to `executor_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:746: undefined reference to `executor_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:749: undefined reference to `executor_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:752: undefined reference to `executor_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:676: undefined reference to `sapi_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:469: undefined reference to `sapi_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:655: undefined reference to `sapi_globals_id'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
增加mysql扩展的时候出现错误,麻烦看看。

TOP

假如你是用lanmp.tar.gz安装的
cd lanmp/php-5.2.17
可以通过phpinfo来查看原本php的编译参数,如下
./c ...
bluegua 发表于 2011-11-15 17:13



    按照这么做后,查看phpinfo文件信息,
Command './configure' '--prefix=/www/wdlinux/php-5.2.17' '--with-config-file-path=/www/wdlinux/etc' '--with-mysql=/www/wdlinux/mysql' '--with-iconv=/usr' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-ftp' '--with-apxs2=/www/wdlinux/apache/bin/apxs'


Command './configure' '--prefix=/www/wdlinux/php-5.2.17' '--with-config-file-path=/www/wdlinux/etc' '--with-mysql=/www/wdlinux/mysql' '--with-iconv=/usr' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-ftp' '--with-apxs2=/www/wdlinux/apache/bin/apxs'
./configure' '--prefix=/www/wdlinux/php-5.2.17' '--with-config-file-path=/www/wdlinux/etc' '--with-mysql=/www/wdlinux/mysql' '--with-iconv=/usr' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-ftp' '--with-apxs2=/www/wdlinux/apache/bin/apxs'

还是这样,没看见加载mysqli

TOP

没有mysqli的的参数
看清提问三步曲及多看教程/FAQ索引(wdcp,v3,一键包,wdOS),益处多多.wdcp工具集 阿里云主机8折优惠码

TOP

什么意思,我用configure 添加了啊,在哪里设置mysqli参数。

TOP

返回列表