Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Problems with mysql support in PHP
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/my
s
ql.so

Do I need to declare this in php.ini? Such as:

extension=mysql.so

Any HELP would me appreciated!



Report this thread to moderator Post Follow-up to this message
Old Post
jbottero
10-19-04 08:57 AM


Re: Problems with mysql support in PHP
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, s
o
> 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-i
n
> ; 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/m
ys
> ql.so
>
> Do I need to declare this in php.ini? Such as:
>
> extension=mysql.so
>
> Any HELP would me appreciated!
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Jamie Isaacs
10-20-04 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:01 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.