特急,请问高手,mysql函数加载的问题??赠50分

aspider 2003-02-26 11:35:54
错误信息:
Fatal error: Call to undefined function: mysql_connect() in /var/www/ucn/index4.php on line 18


源文件:index4.php
<? echo "u-cn welcome you, under construction!!!"; ?><? echo phpinfo();?>
122222222222222222222222222222222222222222222222222222222
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
------下面是第18行
$test = mysql_pconnect('localhost', 'go', '123456') or die(mysql_error());
?>


操作系统为:linux rehat8.0
究竟这样正确加载mysql??????
请详细解答
谢谢!!!
...全文
73 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
aspider 2003-02-26
  • 打赏
  • 举报
回复
我的phpinfo()的configure command
'--with-mysql=shared,/usr'
mysql安装成功???
需要重新安装??
phpteam 2003-02-26
  • 打赏
  • 举报
回复
我知道你PHP安装成功了,你用phpinfo()中的Configure Command一项能看到--with-mysql吗??如果没看到说明你没安装成功嘛!
aspider 2003-02-26
  • 打赏
  • 举报
回复
已经安装了php-mysql的包
能够解析部分php代码,如
<? echo "u-cn welcome you, under construction!!!"; ?><? echo phpinfo();?>
显示输出正常;
但执行下面mysql函数出错!!!
$test = mysql_pconnect('localhost', 'go', '123456') or die(mysql_error());
?>

错误信息:
Fatal error: Call to undefined function: mysql_connect() in /var/www/ucn/index4.php on line 18

应该是函数加载的问题??
但要怎样解决???
phpteam 2003-02-26
  • 打赏
  • 举报
回复
rpm -Uvh php-mysql-x.x.x-x.x.x.rpm

=》

rpm -ivh php-mysql-x.x.x-x.x.x.rpm
phpteam 2003-02-26
  • 打赏
  • 举报
回复
据说在redhat8下,尽管安装的时候选了PHP和MYSQL,但还是要手工安装一个php-mysql-x.x.x-x.x.x.rpm包的,其中x.x.x为版本号。

你可以用rpm -qa|grep php-mysql看看时候已安装这个包,或者用phpinfo()查看,如果是without=mysql则说明未安装过。

安装方式: rpm -Uvh php-mysql-x.x.x-x.x.x.rpm
pantech_36 2003-02-26
  • 打赏
  • 举报
回复
你到目录底下去找有没有mysql.so这个文件如果没有,我可以给你一个你可以将它拷到php的连接目录里就OK了
aspider 2003-02-26
  • 打赏
  • 举报
回复
请指教啊,好郁闷
wuxyun 2003-02-26
  • 打赏
  • 举报
回复
新鲜!
aspider 2003-02-26
  • 打赏
  • 举报
回复
Configure Command的内容:
'./configure' '--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared'

'--with-mysql=shared,/usr'

'--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2=/usr/sbin/apxs'


有什么问题???
phpteam 2003-02-26
  • 打赏
  • 举报
回复
你把phpinfo()的configure command贴出来吧!

21,891

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧