![]() |
The classic MySQL connect error
Newbie speaking…
I've followed the 'perfect setup for CentOS 5.0' and I've got everything running fairly well. However, I can't fire up my test MySQL script - I get Quote:
* I understand that MySQL isn't turned on by default in PHP5. * I understand that MySQL is loaded on my system, since I'm running ISPConfig and it uses MySQL. * I understand that my PHP probably doesn't have MySQL installed as an extension, since phpinfo says Quote:
So I'm wondering - how to activate MySQL in PHP5, and it seems as if I have to recompile PHP. I’ve got 3 questions: 1) I’m guessing that I can take the entire configure command in the big box at the top of the phpinfo() display and run that (tweaking the ‘-–without-mysql’ of course). True? 2) What directory do I run this from? There’s a pile of ‘.h’ files in ‘/usr/include/php/main’ - do I go there? Or where? 3) Do I need anything else? Thanks for any help ... swggy |
Quote:
Quote:
Quote:
1) Make sure that you have the php mysql module installed: yum install php-mysql If the command says that it is already installed, you must check if the module is loaded. Have a look at the php.ini file, the file is most likely in /etc/php5/apache2/ php.ini or a similar location in the /etc directory. There must be a line in the file like: extension=mysql.so if you do not have this line, add it at the end of the file and restart your apache webserver. |
Thanks, but that didn't fix it ...
I can get in through Putty on the CLI with Quote:
phpinfo says my config file is /etc/php.ini (which is the file I've been making your changes to), and it says that 'extension_dir=./' - is that OK? The tables at the bottom of the phpinfo report jump straight from 'mime_magic' to 'openssl', so adding the 'extension=mysql.so' doesn't seem to have had any effect... I also see that I have the following in /usr/lib/php/modules: Quote:
- thanks. |
i have same problem on perfect suse 10.2
isconfig is working, phpmyadmin is working - all users can login and root has all mysql privileges but when i test script to connect mysql then there is mysql_connect error message... :confused: |
Contrary to your response, the PHP site itself here... http://us2.php.net/mysql says clearly that for PHP 5 on a Linux OS, PHP needs to be reconfigured before MySQL is supported:
Quote:
|
Pyro - once I get a response that fixes my problem I'll post it.
|
Quote:
Quote:
Quote:
But if you want to mess up your setup, please recompile it. Please post the output of: locate php.ini Also set: extension_dir=/usr/lib/php/modules in all php.ini files that you find in /etc and its subdirectories. |
Quote:
yast -i php-mysql |
Here's the output - it's only in /etc
Quote:
Don't be too grumpy with the newbie - I'm vey grateful. Thanks. |
yess- extension_dir=/usr/lib/php5/modules did the trick.
tnx'! |
| All times are GMT +2. The time now is 09:00. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.