MagnuM wrote:

Later edit: libmysql.dll is in my Path, and I still got the same error.

How did you check? Did you try the Start -> Run trick I mentioned?

Also, the LoadFile C:/programs/php-5.2.6/php5ts.dll isn't necessary/supposed to be there, so I would try removing that and giving it a shot (not that I would expect that to affect extensions not loading... but you never know).

Finally, did you double check that the DLL library C:\programs\php-5.2.6\ext\php_mysql.dll actually exists?

    bradgrafelman wrote:

    How did you check? Did you try the Start -> Run trick I mentioned?

    Yes of course, it happens exactly how you predicted.

    bradgrafelman wrote:

    Finally, did you double check that the DLL library C:\programs\php-5.2.6\ext\php_mysql.dll actually exists?

    Man, all the libraries are there. I have tried with the MSI installer, and still got the same problems. I simply don't know what to do ...

    Has anyone tried before, to make the Apache 2.2.8 and PHP 5.2.6 working together?

    P.S. I have already made Apache 2.0.63 and PHP 4.4.8 working today, without putting anything to path.

      MagnuM wrote:

      Has anyone tried before, to make the Apache 2.2.8 and PHP 5.2.6 working together?

      Yes, and I haven't had any problems doing it in the past.

      I'm puzzled as to why the MySQL extension won't load for you. There's normally only a small number of issues to deal with: setting the correct extension dir in the php.ini file, ensuring that libmysql.dll is in the main PHP directory, adding that main PHP directory to the system's PATH environment variable and restarting the entire system. It appears as though we've troubleshooted all of this issues, however.

      At this point, all I have are two further suggestions:

      1. Completely remove PHP from your system - remove all references to it in Apache's httpd.conf file, and delete the PHP install directory, then reinstall PHP. I've always preferred doing the manual .zip install as opposed to the MSI, though that's just a personal preference.

      2. Try using the [man]MySQLi[/man] or [man]PDO[/man] extensions, since the MySQL extension has been deprecated in favor of these upgraded libraries.

        I prefer the zip version myself.

        Anyway, a strange thing is happening. I have copied the libmysql.dll, into Apache 2.2 bin directory, and I have not longer receive the error for MySQL, ony for PostgreSQL library. I have read this on other forums. The point is, that I really need to use the PgSQL extension as well.

          That's quite odd. If you moved the libmysql.dll around to a different folder and it works, it really still sounds like a path issue.

          Try doing this... open a command prompt on the server (Start -> Run, type in cmd) and execute this command:

          path >desktop\sys_path.txt

          This will place a .txt file on the desktop containing your server's current PATH variable value; paste the contents of that text file here in a post.

            The strange thing is that I have some other extension loading, which are not throwing any error, like: php_mbstring.dll, php_gd2.dll, php_exif.dll ... only MySQL and PgSQL are with troubles.

            But with MySQL I have resolved, by puttin' libmysql.dll in Apache 2.2 bin directory.

            Now what about PgSQL, which dll should I put there?

              I don't know whether i am doing the right way or not but just a hack or method i used to remove that mysql problem is putting the libmysql.dll to windows system folder and restart the apache server.

              I am not sure yet about pgsql which dll is to be copied in there...

                5 days later
                rajug wrote:

                I don't know whether i am doing the right way or not but just a hack or method i used to remove that mysql problem is putting the libmysql.dll to windows system folder and restart the apache server.

                Apparently this used to be in the PHP manual, but they've long since realized their mistake:

                PHP Manual wrote:

                Note: Upgrading from a previous PHP version Previous editions of the manual suggest moving various ini and DLL files into your SYSTEM (i.e. C:\WINDOWS) folder and while this simplifies the installation procedure it makes upgrading difficult. We advise you remove all of these files (like php.ini and PHP related DLLs from the Windows SYSTEM folder) before moving on with a new PHP installation.

                Again, ensuring that the main PHP directory containing all of the .dll files has been added to your system's PATH environment variable and restarting the system should work just fine.

                rajug wrote:

                I am not sure yet about pgsql which dll is to be copied in there...

                Actually, the php_pgsql.dll has no other DLL dependencies that I've discovered; I was able to load this extension just fine even after removing all of the extra DLL's that came with PHP.

                EDIT: Just confirmed with a dependency walker; php_pgsql.dll only requires a DLL from the Winsock2 library and MSVCRT.DLL, a Visual C++ runtime library.

                  bradgrafelman wrote:

                  EDIT: Just confirmed with a dependency walker; php_pgsql.dll only requires a DLL from the Winsock2 library and MSVCRT.DLL, a Visual C++ runtime library.

                  I checked it, and its in Windows\System32 directory.

                  Its strange that the combination of Apache 2.0 and PHP 4.4 is working smooth with PgSQL support, on my PC.

                    Hi, I'm having a very similar issue, the pgsql module is not being loaded, could you solve this in any way?

                      6 days later

                      I, too, am experiencing a similar problem -- I can't get pdo_pgsql or pgsql to load.

                      PHP 5.2.6, Apache 2.2.8, PostgreSQL 8.3.1 on WinXP (fully patched). PHP, Apache, and Postgres all appear to be functioning properly, individually. (And Windows, well... it's status quo! 😉 )

                      As a test just to see if I had everything wired up correctly, I tried loading MSSQL and that appears to have worked, and after reading this thread, I decided to try MySQL and it appears to have failed.

                      Given the following sample portion of my php.ini:

                      extension_dir = "C:\Program Files\php\ext"
                      
                      extension=php_pdo.dll
                      
                      extension=php_pgsql.dll
                      extension=php_pdo_pgsql.dll
                      
                      extension=php_mssql.dll
                      extension=php_pdo_mssql.dll
                      
                      extension=php_mysql.dll
                      extension=php_pdo_mysql.dll

                      the only extensions that are shown by get_loaded_extensions() are PDO, mssql, and pdo_mssql. Ultimately I want to use PDO/pdo_pgsql but I had pgsql thrown in there too as I thought it might be a prerequisite; now I realize it's not, but just kept it included for troubleshooting purposes.

                      A couple asides:

                      • where would I look -- php/apache log file, system log, etc. -- to get more detailed info on what exactly is causing the failure?

                      • should I need to load php_pdo.dll as well as php_pdo_[driver].dll to get this to work?

                      • The O.P. mentioned the line "LoadFile C:/programs/php-5.2.6/php5ts.dll" in httpd.conf and I don't remember seeing this in the install instructions I followed. What is it?

                      Thanks in advance for any help! I would really like to get this running ASAP. (I have been enjoying a week's vacation from MS development tools and would really like that to continue!) Even if someone can confirm that this is a known bug and nothing that can be fixed without PHP-source-level intervention, that would help me to progress with my projects. Thanks!

                        I found these forum posts when I experienced this same problem.

                        I'm trying to install MediaWiki on a Windows server. Normally I don't use Windows, but I'm familiar with all the packages, so I did a piece-wise install of the following:

                        Fresh installation yesterday:

                        Apache 2.2.8
                        PHP 5.2.6
                        * Postgres 8.3.1

                        MediaWiki finds the MySQL extension, but claims the Postgres extension can't be found, even though it is right there. Badly misleading message.

                        Under Linux, I would have slapped it around with strace and posted a bug report. On Windows, I wallow around in the empty corridors in a trance of learned helplessness until I manage to google a useful forum.

                        Somewhere along the way I read that this problem can be caused by DLLs not being loaded and that adding something to the PATH can help.

                        I appended "C:\Program Files\PostgreSQL\8.3\bin" to my PATH variable and rebooted. Without the reboot, it did nothing.

                        After rebooting, the MediaWiki installer detects Postgres. Woohoo, I'm back in business.

                        Finding the other comments in this forum was a big help. Otherwise, I would have assumed I had done something wrong myself.

                          MaxEnt wrote:

                          I appended "C:\Program Files\PostgreSQL\8.3\bin" to my PATH variable and rebooted. Without the reboot, it did nothing.

                          This, with slight modification, worked to solve my problem.

                          My first attempt was to append exactly what you wrote to my PATH var. It didn't work, even after reboot.

                          I took another look at what was already in the PATH var and noted that none of the other directories were using the "quoted" style, and also all had trailing backslashes.

                          So I modified the newly added PATH entry to exactly C:\Program Files\PostgreSQL\8.3\bin[/COLOR] and after a reboot, it worked! (Not even positive the reboot is mandatory -- didn't test.)

                          Thanks for the insight!

                          PS not that I disregarded bradgrafelman's earlier mention of path issues, but when I looked for my libmysql.dll and didn't find something resembling a corresponding "libpgsql.dll", I fell under the assumption that that was a MySQL-specific issue, and didn't think to pursue it much further. rajug was on the right track, but after reading

                          bradgrafelman wrote:

                          EDIT: Just confirmed with a dependency walker; php_pgsql.dll only requires a DLL from the Winsock2 library and MSVCRT.DLL, a Visual C++ runtime library.


                          it didn't seem that was the problem either, because I think that if there were any problems with either of those DLLs installation-wise, I would have encountered issues with them long ago via other apps.

                          So, while there may not be a direct dependency, apparently php still needs access to some of the PG bin files.

                            a month later

                            I have the exactly same problem with this issues.

                            I have tried many solutions provided above without any luck. I just found the stupid solutions for me.

                            Two solutions:

                            Solution 1:
                            1. Copy libmysql.dll to your C:\Windows\System32 folder
                            2. Restart your Apache2.2

                            Not a good solution: It's going to be a nightmare to upgrade future PHP version. You will end up copy more dll files to System32 folder.

                            Solution 2
                            1. Set the PATH environment variables
                            2. Reboot your PC and restart you Apach2.2

                            I just realized that Apache2.2 is the one to load the PATH environment variables for PHP to load the DLLs, but it did not refresh the variable after you set the PATH value and restart Apache2.2.

                            If you look at your PHPINFO() output, the Apache2.2 is still using the previous PATH value. According to M$ document, the new PATH value is in the windows memory and registry, while Apache won't read from the memory or registry for some reasons.

                            Anyway, the solutions is as simple as rebooting your PC. How stupid is that?

                            BTW, I register this forum because this issues. :-)

                              a month later
                              bradgrafelman;10870138 wrote:

                              EDIT: Just confirmed with a dependency walker; php_pgsql.dll only requires a DLL from the Winsock2 library and MSVCRT.DLL, a Visual C++ runtime library.

                              Do you mean I need to have that an extra DLL to run pgsql in my local system? It was few months before when I had tried to do the simple process to install pg with PHP 5.2.5 and it had worked fine (it was also on win xp). But the same process is not happening well now.

                              So how can I have that DLL to make it working? Can you please give a brief steps to go ahead?

                              Thank you in advance!

                                Write a Reply...