Home > Archive > PHP Language > October 2004 > Problems with mysql support in PHP
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problems with mysql support in PHP
|
|
| jbottero 2004-10-19, 3:57 am |
| I recently installed Red Hat Enterprise Advanced Server 3. As part of the
install, I asked it to install MySQL and apache 2. I have discovered that
PHP does not seemed to have been installed with MySQL support:
Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/test.php on line 6
But when I look at <? phpinfo(); ?> is see:
I see that it has been configured with --with-mysql=shared,/usr.
Within php.conf (which gets included in the httpd.conf), is this line:
LoadModule php4_module modules/libphp4.so
Also when I run phpinfo() is see that --with-mysql=shared,/usr is there, so
when php was installed it should have been compiled with MySQL support.
php.ini says this about MySQL:
[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On
; Maximum number of persistent links. -1 means no limit.
mysql.max_persistent = -1
; Maximum number of links (persistent + non-persistent). -1 means no limit.
mysql.max_links = -1
; Default port number for mysql_connect(). If unset, mysql_connect() will
use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only
look
; at MYSQL_PORT.
mysql.default_port =
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =
; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =
; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo
get_cfg_var("mysql.default_password")
; and reveal this password! And of course, any users with read access to
this
; file will be able to reveal the password as well.
mysql.default_password =
; Maximum time (in secondes) for connect timeout. -1 means no limimt
mysql.connect_timeout = -1
; Trace mode. When trace_mode is active (=On), warnings for table/index
scans and
; SQL-Erros will be displayed.
mysql.trace_mode = Off
Also, I see mysql.so at
../usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mys
ql.so
Do I need to declare this in php.ini? Such as:
extension=mysql.so
Any HELP would me appreciated!
| |
| Jamie Isaacs 2004-10-20, 3:56 pm |
|
Had the same problem with debian.
apt-get php4-mysql
It solved the problem.
-JI
jbottero wrote:
> I recently installed Red Hat Enterprise Advanced Server 3. As part of the
> install, I asked it to install MySQL and apache 2. I have discovered that
> PHP does not seemed to have been installed with MySQL support:
>
> Fatal error: Call to undefined function: mysql_connect() in
> /var/www/html/test.php on line 6
>
> But when I look at <? phpinfo(); ?> is see:
>
> I see that it has been configured with --with-mysql=shared,/usr.
>
> Within php.conf (which gets included in the httpd.conf), is this line:
>
> LoadModule php4_module modules/libphp4.so
>
> Also when I run phpinfo() is see that --with-mysql=shared,/usr is there, so
> when php was installed it should have been compiled with MySQL support.
>
> php.ini says this about MySQL:
>
>
> [MySQL]
> ; Allow or prevent persistent links.
> mysql.allow_persistent = On
>
> ; Maximum number of persistent links. -1 means no limit.
> mysql.max_persistent = -1
>
> ; Maximum number of links (persistent + non-persistent). -1 means no limit.
> mysql.max_links = -1
>
> ; Default port number for mysql_connect(). If unset, mysql_connect() will
> use
> ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
> ; compile-time value defined MYSQL_PORT (in that order). Win32 will only
> look
> ; at MYSQL_PORT.
> mysql.default_port =
>
> ; Default socket name for local MySQL connects. If empty, uses the built-in
> ; MySQL defaults.
> mysql.default_socket =
>
> ; Default host for mysql_connect() (doesn't apply in safe mode).
> mysql.default_host =
>
> ; Default user for mysql_connect() (doesn't apply in safe mode).
> mysql.default_user =
>
> ; Default password for mysql_connect() (doesn't apply in safe mode).
> ; Note that this is generally a *bad* idea to store passwords in this file.
> ; *Any* user with PHP access can run 'echo
> get_cfg_var("mysql.default_password")
> ; and reveal this password! And of course, any users with read access to
> this
> ; file will be able to reveal the password as well.
> mysql.default_password =
>
> ; Maximum time (in secondes) for connect timeout. -1 means no limimt
> mysql.connect_timeout = -1
>
> ; Trace mode. When trace_mode is active (=On), warnings for table/index
> scans and
> ; SQL-Erros will be displayed.
> mysql.trace_mode = Off
>
>
> Also, I see mysql.so at
> ./usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mys
> ql.so
>
> Do I need to declare this in php.ini? Such as:
>
> extension=mysql.so
>
> Any HELP would me appreciated!
>
>
|
|
|
|
|