Re: Re: Need help with PHP / MySQL connect problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For those who didn't join this thread at the beginning, I'm running MySQL 4.0.21, Apache 2.0.52 and PHP 5.0.2 on a Windows XP system.

I installed in the sequence - MySQL, then Apache, then PHP. MySQL was running when the others were installed (which is what the book I am using seemed to indicate). Apache was not running when PHP was installed.

What does php.ini have for this line
display_errors = On

Now we are getting somewhere. Even though error_reporting was set to E_ALL, display_errors was Off. I set it On and now I'm getting an error.

Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\example\test_connect.php on line 15

the phpinfo() display doesn't reference MySQL at all. It does reference SQLite with the following info:

SQLite supportenabled:
PECL Module version 2.0-dev $Id: sqlite.c,v 1.146.2.2 2004/08/02 22:43:42 iliaa Exp $
SQLite Library: 2.8.14
SQLite Encoding: iso8859

Directive: sqlite_assoc_case, Local Value: 0, Master Value: 0

So it looks like MySQL didn't get configured with PHP.

In the PHP FAQ on database issues, I found the following:

"
4. PHP 5 no longer bundles MySQL client libraries, what does this mean to me? Can I still use MySQL with PHP? I try to use MySQL and get "function undefined" errors, what gives?

Yes. There will always be MySQL support in PHP of one kind or another. The only change in PHP 5 is that we are no longer bundling the client library itself. Some reasons in no particular order:
   * Most systems these days already have the client library installed.
* Given the above, having multiple versions of the library can get messy. For example, if you link mod_auth_mysql against one version and PHP against another, and then enable both in Apache, you get a nice fat crash. Also, the bundled library didn't always play well with the installed server version. The most obvious symptom of this being disagreement over where to find the mysql.socket Unix domain socket file. * Maintenance was somewhat lax and it was falling further and further behind the released version. * Future versions of the library are under the GPL and thus we don't have an upgrade path since we cannot bundle a GPL'ed library in a BSD/Apache-style licensed project. A clean break in PHP 5 seemed like the best option.

This won't actually affect that many people. Unix users, at least the ones who know what they are doing, tend to always build PHP against their system's libmyqlclient library simply by adding the --with-mysql=/usr option when building PHP. Windows users may enable the extension php_mysql.dll inside php.ini. Also, be sure libmysql.dll is available to the systems PATH. For more details on how, read the FAQ on <http://www.php.net/manual/en/faq.installation.php#faq.installation.addtopath>setting up the Windows systems PATH. Because libmysql.dll (and many other PHP related files) exist in the PHP folder, you'll want to add the PHP folder to your systems PATH."

I added my PHP folder (C:\php5\) to my system path and restarted (libmysql.ddl is in php5). Still get the error. I enabled the extension php_mysql.dll in php.ini and Apache startup says it can't find it (php_mysql.dll is in C:\php5\ext).

So, should I move php_mysql.dll to c:\php5, change the system path, or what? And what about php.ini showing sqlite instead of MySQL? Do I need to get the MySQL client libraries (what are they called and where do I put them - I already have some mysql dll's in the PHP libraries.

Linda

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux