PHP and MYSQL
Advancewarning
advancewarning at swbell.net
Wed Jan 22 16:51:48 CST 2003
This is all I got under php.conf located in /etc/httpd/conf.d
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
LoadModule php4_module modules/libphp4.so
#
# Cause the PHP interpreter handle files with a .php extension.
#
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 524288
</Files>
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
Michael Pratt
Pratt's Computers
http://pratt.is-a-geek.com
MCSE, CNA
-----Original Message-----
From: Eric R. [mailto:rossiter at discoverynet.com]
Sent: Wednesday, January 22, 2003 10:35 AM
To: Advancewarning
Cc: KCLUG
Subject: Re: PHP and MYSQL
Check config.php and verify that you have the correct user, pass, and DB
name.
E
Advancewarning wrote:
> It shows up I have the MySQL Database in there. I created a new
> database called 'pratt' and created a table called 'Info' but it
doesn't
> seem to work.
>
> Michael Pratt
> Pratt's Computers
> http://pratt.is-a-geek.com
> MCSE, CNA
>
>
> -----Original Message-----
> From: Eric R. [mailto:rossiter at discoverynet.com]
> Sent: Wednesday, January 22, 2003 10:14 AM
> To: Advancewarning
> Cc: KCLUG
> Subject: Re: PHP and MYSQL
>
> Advancewarning wrote:
>
>>What is the trick to getting PHP to connect to MYSQL?
>>
>>
>>
>>It blows up at this line:
>>
>>$connection = mysql_connect("$server","$username","$password");
>>
>>
>>
>>Giving me this:
>>
>>*Fatal error*: Call to undefined function: mysql_connect() in
>>*/web/test.php* on line *15*
>>
>
>
> Well, as it was so elequently explained to me... :)
>
> mysql_connect can't find the database that it's looking for.
>
> Create a test page called info.php:
>
> <?php phpinfo() ?>
>
> Open it in your browser... you should see a block of information about
> MySQL... (my guess is, right now, it won't be there)
>
> (If it IS there, have you loaded the default MySQL DB after MySQL
> install?? I belive that was a fix for an earlier glitch of this
sort.)
>
> If you compiled from source, run ./configure again with the
--with-mysql
>
> option.
>
> Depending on your location of MySQL, it would look something like:
>
> ./configure --prefix=/usr/local/php
> --with-config-file-path=/usr/local/php --with-mysql=/usr/local/mysql
> --with-apxs=/usr/sbin/apxs --enable-track-vars --enable-magic-quotes
> --enable-debugger
>
> If you're using rpm's, good luck, never got'em to work.
>
> Have a quality day,
> E
>
>
>
More information about the Kclug
mailing list