mysql_connect problem

mysql_connect problem

am 10.12.2006 02:43:02 von Ted Fines

------=_Part_73361_17948887.1165714982627
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

I've setup an Apache 2.2.3, PHP 5.2.0, MySQL 5.0.27 on a Solaris 9 system.

The install appeared to go well. To test the Apache/PHP/MySQL integration,
I added a simple test.php to the Apache document folder, consisting of:

phpinfo();
?>

When I access the URL/test.php, it displays as expected. That is, I see the
PHP version, date, configure command and detail about all of the modules,
including curl, gd, IMAP, and MySQL. Looks like a perfectly normal
rendition of phpinfo(). So it looks great, like everything works.

But then I try to load a web app on the server, like SMF or phpBB, they both
tell me that I don't have MySQL configured.

I don't understand why the phpinfo() command would show the MySQL config
info, yet the web apps would think that MySQL was not configured.

So I created another test php file, mysqltest.php, with these lines:
$link = mysql_connect('localhost', 'testuser', '*******');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

Now, as testuser, I can login to the database using the command line "mysql
-u testuser -p" and entering the password.

But when I try accessing the above file, I get no output in the browser, but
in the apache errlog file, I get:
PHP Fatal error: Call to undefined function: mysql_connect() in
/opt/apache-php/apache/htdocs/mysqltest.php on line 2

So it looks like my PHP install just doesn't even know about the
'mysql_connect' function.
extensions_dir = /opt/apache-php/php4/lib/php/extensions, and that dir does
contain the mysql.so file. If I move it out of that folder and rerun
phpinfo(), it displays without showing any MySQL config data.

Any help? I'm just stuck! My directive for MySQL inclusion for the PHP
../configure command was:
--with-mysql=shared,$BLIB/mysql

....where $BLIB was set to /opt/apache-php/libs

Thanks,
Ted

------=_Part_73361_17948887.1165714982627--

Re: mysql_connect problem

am 10.12.2006 11:44:09 von Niel Archer

Hi

do you have the mysqli interface installed instead of the mysql one?

Niel

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mysql_connect problem

am 10.12.2006 16:23:24 von bob plano

i think i had a problem like this installing these on windows xp.
mysql didnt install the default accounts so mysql wouldnt work even
though it showed up on the phpinfo() page. i just reinstalled mysql
and that seemed to work

On 12/10/06, Niel Archer wrote:
> Hi
>
> do you have the mysqli interface installed instead of the mysql one?
>
> Niel
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php