ternto333 Posted May 7, 2008 Share Posted May 7, 2008 I am unfamiliar with the new mysqlnd - a replacement for libmysql - and haven't come across anything showing how to install this on windows. I have installed php 5.3, which uses by default mysqlnd. It doesn't recognize the function mysql_connect, which tells me that something is wrong with the mysql configuration. In the phpinfo() printout, the only mysql related stuff that it prints out is this: mysqlnd mysqlnd => enabled Version => mysqlnd 5.0.3-dev - 080129 - $Revision: 1.3.2.14 $ Client statistics => bytes_sent => 0 bytes_received => 0 packets_sent => 0 packets_received => 0 protocol_overhead_in => 0 protocol_overhead_out => 0 result_set_queries => 0 non_result_set_queries => 0 no_index_used => 0 bad_index_used => 0 buffered_sets => 0 unbuffered_sets => 0 ps_buffered_sets => 0 ps_unbuffered_sets => 0 flushed_normal_sets => 0 flushed_ps_sets => 0 ps_prepared_never_executed => 0 ps_prepared_once_executed => 0 rows_fetched_from_server_normal => 0 rows_fetched_from_server_ps => 0 rows_buffered_from_client_normal => 0 rows_buffered_from_client_ps => 0 rows_fetched_from_client_normal_buffered => 0 rows_fetched_from_client_normal_unbuffered => 0 rows_fetched_from_client_ps_buffered => 0 rows_fetched_from_client_ps_unbuffered => 0 rows_fetched_from_client_ps_cursor => 0 rows_skipped_normal => 0 rows_skipped_ps => 0 copy_on_write_saved => 0 copy_on_write_performed => 0 command_buffer_too_small => 0 connect_success => 0 connect_failure => 0 connection_reused => 0 reconnect => 0 pconnect_success => 0 active_connections => 0 active_persistent_connections => 0 explicit_close => 0 implicit_close => 0 disconnect_close => 0 in_middle_of_command_close => 0 explicit_free_result => 0 implicit_free_result => 0 explicit_stmt_close => 0 implicit_stmt_close => 0 mem_emalloc_count => 0 mem_emalloc_ammount => 0 mem_ecalloc_count => 0 mem_ecalloc_ammount => 0 mem_erealloc_count => 0 mem_erealloc_ammount => 0 mem_efree_count => 0 mem_malloc_count => 0 mem_malloc_ammount => 0 mem_calloc_count => 0 mem_calloc_ammount => 0 mem_realloc_calloc => 0 mem_realloc_ammount => 0 mem_free_count => 0 Collecting statistics => Yes Collecting memory statistics => No Command buffer size => 2048 Read buffer size => 32768 ??? Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/ Share on other sites More sharing options...
benphp Posted May 7, 2008 Share Posted May 7, 2008 Here's an ini that works for me. Check to see where the ini is in your installation. Mine is in c:\windows\php.ini [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-535401 Share on other sites More sharing options...
ternto333 Posted May 7, 2008 Author Share Posted May 7, 2008 Thanks for the file, but the problem is probably not with the php.ini file. I have two installations of php: 5.2 and 5.3. I tested the same ini file for both versions of php, and php5.2 connected, php5.3 gave me the "Fatal error: Call to undefined function mysql_connect()". This signals to me that something is jacked up with the mysqlnd, since that seems to be the only difference... Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-535484 Share on other sites More sharing options...
wildteen88 Posted May 7, 2008 Share Posted May 7, 2008 As far as I have read mysqlnd is a replacement for libmysql.dll. You should still need to enable php_mysql.dll (mysql_* functions) or php_mysqli.dll (mysqli_*) within the php.ini, in order to use the MySQL libraries in PHP5.3 Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-535511 Share on other sites More sharing options...
benphp Posted May 7, 2008 Share Posted May 7, 2008 I know it's a PITA every time I install in windows. Here are some things to check: uncomment these and set them to correct directory: extension_dir ="C:\PHP\ext" extension=php_mysql.dll extension=php_mysqli.dll copy the *mysql*.dll files to your php ext directory (C:\PHP\ext) REBOOT your machine after you change the php.ini Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-535525 Share on other sites More sharing options...
DarkWater Posted May 7, 2008 Share Posted May 7, 2008 Restart your web server, not your whole computer... Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-535528 Share on other sites More sharing options...
benphp Posted May 7, 2008 Share Posted May 7, 2008 The reason why I say to reboot the machine is because I was pulling my hair out last time after restarting IIS and seeing no change. Just for fun, I rebooted the machine and it worked. Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-535534 Share on other sites More sharing options...
DarkWater Posted May 7, 2008 Share Posted May 7, 2008 The reason IIS didn't work properly is because it's made by Microsoft. =) Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-535538 Share on other sites More sharing options...
ternto333 Posted May 7, 2008 Author Share Posted May 7, 2008 Thanks so much for all your input. Here is where I am right now: My ini file has php_mysql.dll and php_mysqli.dll enabled. My extension_dir is properly set, otherwise it spits out lots of errors. I copied libmysql.dll to the ext directory, (but since mysqlnd is apparently replacing this file, I don't know why this step would be necessary...) I restarted my webserver, tested it out and got the "undefined mysql_connect()" error. Then I rebooted my computer, and same thing. I really need a function (getopt) that 5.3 offers, otherwise I'd just stick with what works. I guess mysqldn is built into the php5.3 binary. In other words I don't have to worry about configuring it with a dll file at all? ??? Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-535567 Share on other sites More sharing options...
benphp Posted May 7, 2008 Share Posted May 7, 2008 I've read that it's easier to configure PHP from the ZIP installation rather than the msi install. You might try that. And triple check that you're editing the right php.ini file - by default it's in the windows directory. Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-535574 Share on other sites More sharing options...
ternto333 Posted May 7, 2008 Author Share Posted May 7, 2008 I never messed around with the MSI install, I just downloaded the ZIP package. Also, the ini file is correct. Since I'm running it from the command line, I specified it with the -c option. And in the phpinfo() it reports the correct ini file. Any more tips or avenues I could pursue? Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-535582 Share on other sites More sharing options...
wildteen88 Posted May 8, 2008 Share Posted May 8, 2008 Has PHP5.3 been released yet? I cannot find any official docs from php.net about php5.3 or the mysqlnd extension. It maybe because you have two different versions of PHP installed on the same computer. Perhaps PHP5.2 is interfering with your PHP5.3 installation. Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-536094 Share on other sites More sharing options...
ternto333 Posted May 9, 2008 Author Share Posted May 9, 2008 You are right, 5.2 is somehow interfering with 5.3. I installed 5.3 on a different machine that didn't have any other php installation, and it worked. I wonder what it could be... Quote Link to comment https://forums.phpfreaks.com/topic/104601-has-anyone-gotten-php-53-or-php-6-to-connect-to-mysql-on-windows/#findComment-536625 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.