ruiruigz 发表于 2005-11-14 15:04

[配置] linux下自带PHP不支持mysql,怎么办?

linux下自带PHP不支持mysql,怎么办?
linux下,以PHP+apache+mysql构建web网站,其中mysql(mysql-3.23.57-pc-linux-i686.tar.gz)是以Tarball方式安装的,php和apache是系统自带的.
现在网站静态部分无问题,有后台数据库无法访问,例打开http://XXXX/phpmyadmin,网页报错:cannot load MySQL extension,
please check PHP Configuration.
Documentation
如打开网页info.php, 显示页面无mysql板块,php为4.2.2版.
请大家帮助.

HonestQiao 发表于 2005-11-14 15:05

1. 看看是否有php-mysql的rpm可以安装

2. 如果找不到,重新编译。

ruiruigz 发表于 2005-11-14 15:17

1. 看看是否有php-mysql的rpm可以安装
回答,网上找不到啊.我需要的是php-mysql-4.2.2

2.如果找不到,重新编译。
回答,我这个php4.22是装系统时就装上去的.怎么重新编译啊.或着说我怎么才能把它删干净,或着我怎么将它升级到php5.0,以使它支持mysql.

多谢!

HonestQiao 发表于 2005-11-14 15:35

http://w.yi.org/ftp/FAPM/PHP/php_manual_zh/install.unix.html

ipaddr 发表于 2005-11-14 21:35

原帖由 ruiruigz 于 2005-11-14 15:17 发表
1. 看看是否有php-mysql的rpm可以安装
回答,网上找不到啊.我需要的是php-mysql-4.2.2

2.如果找不到,重新编译。
回答,我这个php4.22是装系统时就装上去的.怎么重新编译啊.或着说我怎么才能把它删干净,或着我 ...

1.从你安装光盘上找.

2.
删除:
rpm -e php --nodeps

安装:
wget http://www.php.net/......./

tar zxvf .........
./configure --with-mysql --with-apxs2=/usr/...
make
make install

ruiruigz 发表于 2005-11-15 10:26

--with-apxs2=/usr/...
上面这个参数不明白.我apche2.X是系统自带的,所以我找不到--with-apxs2=    的正确位置.
请大老帮忙啊.搞了好长时间啦.

ruiruigz 发表于 2005-11-15 10:57

找不到正确with-apxs2位置,编译中断,代码如下:

Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no
checking for Apache 1.x module support... no
checking for member fd in BUFF *... (cached) no
checking for mod_charset compatibility option... no
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS...

Sorry, I cannot run apxs.Possible reasons follow:

1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)

The output of /usr/sbin/apxs follows:
cannot open /usr/lib/httpd/build/config_vars.mk: No such file or directory at /usr/sbin/apxs line 231.
configure: error: Aborting

HonestQiao 发表于 2005-11-15 10:59

执行并告诉我结果:
whereis apxs
find / -name "apxs"
whereis httpd
httpd -v

ruiruigz 发表于 2005-11-15 11:04

# whereis apxs
apxs: /usr/sbin/apxs
注释:该机上原来没有apxs文件,我从另一台linux上copy过来,放在此处的.httpd是系统自带的.
# whereis httpd
httpd: /usr/sbin/httpd.worker /usr/sbin/httpd /etc/httpd /usr/lib/httpd /usr/share/man/man8/httpd.8.gz

ruiruigz 发表于 2005-11-15 11:06

# whereis apxs
apxs: /usr/sbin/apxs
注释:该机上原来没有apxs文件,我从另一台linux上copy过来,放在此处的.httpd是系统自带的.

# find / -name apxs
/usr/sbin/apxs

# whereis httpd
httpd: /usr/sbin/httpd.worker /usr/sbin/httpd /etc/httpd /usr/lib/httpd /usr/share/man/man8/httpd.8.gz
页: [1] 2 3
查看完整版本: [配置] linux下自带PHP不支持mysql,怎么办?