Re: How to work with embedded mysql from php.

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

 



>
>From: Nishshanka Sirisena <nishshanka@xxxxxxxxxxxxx>
>To: Tommy Pham <tommyhp2@xxxxxxxxx>
>Sent: Sunday, September 20, 2009 7:13:02 AM
>Subject: Re:  How to work with embedded mysql from php.
>
>>I tried with Mysqli using mysqli_server_init() and mysql_server_end() functions and I am using Lighttpd as my web server. But when I'm running the page error log of the lighttpd web server listed following error. And I have correctly configured lighttpd-php and mysql.
>
>PHP Fatal error:  Call to undefined function mysqli_server_init() in 
>                                                C:\lighttpd\htdocs\web\test_db.php on line 27
>
>2009-09-20 09:02:58: (mod_fastcgi.c.1452) 
>>2009-09-20 09:02:58: (connections.c.764) missing cleanup in fastcgi 
>
>I have no previous experience to use this So please can somebody send me a simple implementation of this issue.
>

Nishshanka,

What version and bitness of PHP are you using?  Did you compile it?  Have you tried connecting to a non embedded MySQL to ensure the configuration of Lighttpd + PHP is correct?  I had breakage of some apps when PHP is configured as CGI/FASTCGI and didn't bother using it as such.  Note: If you didn't build both, you need to match right Visual Studio version of PHP with Lightthpd.  Mix match is very bad...  Official PHP releases are available in VS6 & VS9 only.

What version of embedded MySQL are you using?  Check the phpinfo() to see if MySQL/MySQLi is using MySQLnd driver. MySQLnd cannot connect to MySQL 4.1+ using old authentication. It may look something like this in phpinfo():
Client API version:  mysqlnd 5.0.5-dev - 081106 - $Revision: 286739 $
(This is my build of PHP-5.3.2-dev x64 running with my build of Apache 2.2.13 x64 on Win2008 x64.)

You may have to download the PHP source, do some hacking and then compile it against embedded MySQL's lib/dll.  Look for HAVE_EMBEDDED_MYSQL in PHP's source code files in ext\mysql and ext\mysqli.  After you hack the PHP's source code, you should be able to connect the embedded with this or something similar in PHP:

$mysql = mysql_init();
mysql_options($mysql, MYSQL_OPT_USE_EMBEDDED_CONNECTION, null);
mysql_real_connect($mysql, null,null,null, "database1", 0,null,0);

Of course, depending on your requirement, the other alternative and easy fix is use a non embedded and bind the server to 127.0.0.1.  You'll also don't have to deal with the limitations of embedded ;). http://dev.mysql.com/doc/refman/5.1/en/libmysqld-restrictions.html

Regards,
Tommy


-- 
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