logitechcam Posted February 12, 2007 Share Posted February 12, 2007 Hi guys I want to use mysql 5.0 with php5.2. I got php runs on my computer. but when i try to use mysql with php, i got an error like this: Fatal error: Call to undefined function mysql_connect() . i have already did the Configuration to php.ini file, but, i still have the error. can anyone give me some help? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted February 12, 2007 Share Posted February 12, 2007 You need to enable the mysql extension in the php.ini. It is not to do with MySQL. It is to do with PHP's conifguration. This FAQ thread will be able to help you. Quote Link to comment Share on other sites More sharing options...
logitechcam Posted February 12, 2007 Author Share Posted February 12, 2007 I have aready enable the extension in the php.ini before i posted. But i still have the problem. Help! You need to enable the mysql extension in the php.ini. It is not to do with MySQL. It is to do with PHP's conifguration. This FAQ thread will be able to help you. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted February 12, 2007 Share Posted February 12, 2007 OK. Test to see if PHP is using the correct php.ini you are using. Simply create a file called test.php and add this to it: <?php phpinfo(); ?> Now run that file, look for the line beginning with Configuration File (php.ini) Path. Next that it should state the full path to the php.ini file PHP is using, if it is set to C:/WINDOWS on its own then php is not using the php.ini you are editing so any changes you make to the php.ini will not affect PHP. To insure PHP is using the php.ini you are editing, copy the php.ini to the WINDOWS folder (C:/WINDOWS NOTE: If you don't have a WINDOWS folder move to the WINNT folder instead). Now restart IIS. Does the Configuration File (php.ini) Path line now show the correct path to the php.ini? If it is scroll down until you find the MySQL Heading. If you find the MySQL heading then the MySQL extension is now enabled. If you cant find the MySQL heading then check that you have set the extension_dir directive to point PHP extension folder (C:/PHP/ext) and make sure you have copied a file called libmysql.dll from the PHP folder to the C:/WINDOWS folder. Now restart IIS and run phpinfo again. Check to see if there is a MySQL heading. If there is then the extension is loaded. If you make any changes to the php.ini you must save it and the restart the server. Quote Link to comment Share on other sites More sharing options...
weknowtheworld Posted February 12, 2007 Share Posted February 12, 2007 See here for solution.... Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted February 12, 2007 Share Posted February 12, 2007 Thats for red hat linux! However it does tell pretty much the same as what my FAQ tells you to do and what I said above. Quote Link to comment 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.