abdfahim Posted January 26, 2011 Share Posted January 26, 2011 Hi, I have been using same php.ini and httpd.conf file for long. I have used the same 32-bit APACHE+PHP+MYSQL in my newly bought laptop with a new 64bit Windows 7 (previously I used 32-bit Vista). As a result, all 3 software installed in "Program Files (x86)" folder. I have managed to make Apache+PHP working. Also, 32-bit mySQL is also working (I can run query from command prompt). Only problem is any php can't communicate with mysql. Solution plz. I never worked in 64bit environment before. btw, phpmyadmin is showing error Cannot load mysql extension. Please check your PHP configuration Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/ Share on other sites More sharing options...
Maq Posted January 26, 2011 Share Posted January 26, 2011 Are you sure you have the mysql.dll enabled in your php.ini? Try restarting Apache. Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1165518 Share on other sites More sharing options...
abdfahim Posted January 26, 2011 Author Share Posted January 26, 2011 yes it is enabled .... as I said, same php.ini is working in my desktop without any problem ... extension=php_mysql.dll extension=php_mysqli.dll Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1165525 Share on other sites More sharing options...
Maq Posted January 26, 2011 Share Posted January 26, 2011 Does the .dll reside in the 'extension_dir'? Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1165529 Share on other sites More sharing options...
abdfahim Posted January 26, 2011 Author Share Posted January 26, 2011 yes .... as I said, with exactly same setup, I have the trio (apache-php-mysql) running in my desktop (only except, those are located in "program files", not in "program files (x86)" Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1165532 Share on other sites More sharing options...
abdfahim Posted February 1, 2011 Author Share Posted February 1, 2011 hello experts, i am still facing the same prob ... I have uninstall and reinstall the MySQL, but still same problem. Plz help. Btw, I have my PHP working. Also, MySQL is working individually (from command prompt). Just cant load the extension (though uncommented) Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1168258 Share on other sites More sharing options...
PFMaBiSmAd Posted February 1, 2011 Share Posted February 1, 2011 How did you install PHP? The .msi installer or manually using the .zip package? Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1168260 Share on other sites More sharing options...
abdfahim Posted February 1, 2011 Author Share Posted February 1, 2011 .zip package Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1168261 Share on other sites More sharing options...
PFMaBiSmAd Posted February 1, 2011 Share Posted February 1, 2011 You need to make sure that the php.ini that you are changing is the one that php is using. Create a .php file with <?php phpinfo(); ?> in it and browse to it. The Loaded Configuration File value is the php.ini that php is using. Once you get php to use the php.ini that you are changing, you need to set the php.ini extension_dir setting to point to the folder where the extension .dlls are at. You also need to check that the actual .dll files are present (in programming you cannot assume that something is the same as what you did before, you must check and confirm that it is the same.) Have you checked your web server error log file to see what sort of startup errors are occurring for the mysql/mysqli dll's? Beyond getting all the pieces in the right place, problems loading extensions are usually due to file system user permissions. Do all the files (httpd.conf, php.ini, dll's) and folders have permissions set so that the user that apache is running under can access them? Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1168263 Share on other sites More sharing options...
abdfahim Posted February 1, 2011 Author Share Posted February 1, 2011 Hi, Thanks for details. Some of those I have already checked, some not. Plz find here the responses 1) Loaded Configuration File is C:\php\php.ini - same as my intended file. 2) I have extension_dir = "c:\php\ext" 3) Also, in php.ini, i have extension=php_mysql.dll extension=php_mysqli.dll 4) Both the files are present in C:\php\ext directory (rechecked) Now here is some new checks 5) in error.log in apache server, I haven't find any error listed against mysql 6) Now, this one might be the problem. Because I am very new to WIndows 7 64 bit, also I have installed 32-bit version of MySQL I am suspecting some problem like this. Can you please describe how to check this? Thanks, -Abd Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1168268 Share on other sites More sharing options...
PFMaBiSmAd Posted February 1, 2011 Share Posted February 1, 2011 Does the phpinfo() output show a mysql and/or mysqli section? I thought you stated you installed the three pieces into the 'program files' folder? What is the php.ini and the ext folder doing in c:/php ? The mysql server is a service. Php connects to it on Windows using a TCP/IP connection. As long as the mysql server is running and can be connected to it does not matter what the underlying architecture is. Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1168271 Share on other sites More sharing options...
abdfahim Posted February 1, 2011 Author Share Posted February 1, 2011 This is the main problem, PHPINFO doesn't show mysql or mysqli section. I have installed php in C:/php. Apache and MySQL I have installed in "Program Files (x86)" folder (which is default location for installing 32 bit soft in a 64 bit OS). Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1168273 Share on other sites More sharing options...
PFMaBiSmAd Posted February 1, 2011 Share Posted February 1, 2011 Since there are no startup errors concerning loading the .dll's, it is most likely that php cannot read the php.ini or it cannot see the two lines that should be loading the mysql/mysqli .dll's I'm going to guess that either when you edited php.ini it got saved as php.ini.txt and you have file extensions hidden or you have a syntax error in your php.ini that is preventing the two lines from being seen as valid settings (does changing any other setting in the php.ini affect the phpinfo() output) or you have a file/folder permission problem and php cannot read the php.ini. Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1168275 Share on other sites More sharing options...
abdfahim Posted February 1, 2011 Author Share Posted February 1, 2011 thanks to you I have solved it ! As you said, I might have some problem in php.ini, so I replace that with my backed up one. And, it starts working!! But, a strange thing I found that, all this problem is happening whenever I change the following line in php.ini doc_root = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs to this one doc_root = C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs !!! This is strange. Because my doc root is actually the later one !!! Rather there is no such directory existing like the 1st one ... Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1168278 Share on other sites More sharing options...
PFMaBiSmAd Posted February 1, 2011 Share Posted February 1, 2011 I recommend trying some quotes around the correct setting. Quote Link to comment https://forums.phpfreaks.com/topic/225750-php-cant-communicate-with-mysql/#findComment-1168366 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.