p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: PHP, MySQL, Apache


Message #1 by WH Micro <wh_micro@y...> on Mon, 22 Apr 2002 09:34:41 -0700 (PDT)
Hello:
> 
> I am experiencing some problems with a webserver I'm
> testing at home. I built a php webpage with db
> connectivity on a Win environment using PHPDev4 and
> it
> runs fine even connecting to a remote mysql sever.
> Now, I uploaded this page to the webserver which is
> also running mysql server on a RedHat 7.2 machine
> and
> I can't get the page to load correctly. This is the
> message I get:
> 
> Fatal error: Call to undefined function:
> mysql_connect() in
> /var/www/html/domainName/Maintain/db_connect.php on
> line 13.
> 
> 
> I changed the servername to localhost but still
> can't
> connect.
> 
> Is there some specific configuration that need to be
> done on Linux in order to get php and mysql to work
> side-by-side?
> 
> Note:
> The apache server is a fresh RPM install.
> 
> Thanks in advance for all your help.

=====
www.whmicro.com

__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
Message #2 by David Keyes <dave@s...> on Mon, 22 Apr 2002 9:49:10 -0700
1. run the phpinfo script 
<?php
phpinfo();
?>

to see if MySql is installed. If it isn't (i.e. you have it built as a dynamic module you will need to load it by putting something
like this into your connect script:

        $test=extension_loaded('mysql.so');
        if ($test == FALSE) {
          dl('mysql.so');
        $sockset=shell_exec("ln -s -f /var/lib/mysql/mysql.sock /tmp/mysql.sock");
        }
you may not have to do the temporary socket, check under /tmp to see if the socket is there already.

good luck

Dave

> 
> From: WH Micro <wh_micro@y...>
> Date: 2002/04/22 Mon AM 09:34:41 MST
> To: "beginning php" <beginning_php@p...>
> Subject: [beginning_php] PHP, MySQL, Apache
> 
> Hello:
> > 
> > I am experiencing some problems with a webserver I'm
> > testing at home. I built a php webpage with db
> > connectivity on a Win environment using PHPDev4 and
> > it
> > runs fine even connecting to a remote mysql sever.
> > Now, I uploaded this page to the webserver which is
> > also running mysql server on a RedHat 7.2 machine
> > and
> > I can't get the page to load correctly. This is the
> > message I get:
> > 
> > Fatal error: Call to undefined function:
> > mysql_connect() in
> > /var/www/html/domainName/Maintain/db_connect.php on
> > line 13.
> > 
> > 
> > I changed the servername to localhost but still
> > can't
> > connect.
> > 
> > Is there some specific configuration that need to be
> > done on Linux in order to get php and mysql to work
> > side-by-side?
> > 
> > Note:
> > The apache server is a fresh RPM install.
> > 
> > Thanks in advance for all your help.
> 
> =====
> www.whmicro.com
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/
> 
> 



  Return to Index