peterv6 Posted March 10, 2011 Share Posted March 10, 2011 I'm having a problem with a PHP script that's trying to connect to a MySQL database. This script works perfectly in OS X, but when I run it in Kubuntu, I get the following error: Fatal error: Call to undefined function mysql_connect() in /var/www/Sites/LP2/dbc.php on line 2. The script is as follows: <?php $mysql = mysql_connect('127.0.0.1', 'peterv', 'password'); if (mysql_connect_errno()) { printf("Connect failed: %s\n", mysql_connect_errno()); exit(); } else { printf("Host information: %s\n", mysql_get_host_information($mysql)); } ?> I'm assuming it has something to do with my PHP installation, but I'm a relative newbie to this. Any help or suggestions will be GREATLY appreciated. PETERV Quote Link to comment https://forums.phpfreaks.com/topic/230158-mysql_connect-error-in-php-script-in-kubuntu/ Share on other sites More sharing options...
fenway Posted March 10, 2011 Share Posted March 10, 2011 I think the child board has a sticky on this. Quote Link to comment https://forums.phpfreaks.com/topic/230158-mysql_connect-error-in-php-script-in-kubuntu/#findComment-1185339 Share on other sites More sharing options...
peterv6 Posted March 10, 2011 Author Share Posted March 10, 2011 MySQL version - 5.1.41-3ubuntu12.10 (Ubuntu) What do you mean by "child" board? I did a search for mysql_connect() prior to posting, and found nothing relevant. I'd much rather follow a successful prior post than to post something redundantly. Quote Link to comment https://forums.phpfreaks.com/topic/230158-mysql_connect-error-in-php-script-in-kubuntu/#findComment-1185534 Share on other sites More sharing options...
fenway Posted March 10, 2011 Share Posted March 10, 2011 See here. Quote Link to comment https://forums.phpfreaks.com/topic/230158-mysql_connect-error-in-php-script-in-kubuntu/#findComment-1185549 Share on other sites More sharing options...
peterv6 Posted March 10, 2011 Author Share Posted March 10, 2011 fenway, Thanks for the link, but it refers to the resolution of the problems on a Windows system, and I'm running Kubuntu Linux. I'll see if I can find the correct directory for that, and post it here if I can find it. (If you know which it is, please post it.) Thanks again. Peter V. Quote Link to comment https://forums.phpfreaks.com/topic/230158-mysql_connect-error-in-php-script-in-kubuntu/#findComment-1185572 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.