I've just picked up the most recent versions:

  • PHP - 5.2.0RC6-dev

  • MySQL - 5.0.26

  • Apache - 2.2.3

but I appear to be unable to get the mysql/mysqli extension to work. After ensuring that the path is correctly set, and all the relevant configuration lines are in place, I am able to restart apache cleanly, however the mysql/mysqli extensions are NOT being loaded. I've noticed that certain other extensions do not load mcyrpt and mhash being two notable ones I regularly use, however gd2 and gettext both load correctly.

I've tried copying the libmysql.dll (as supplied by MySQL) into the PHP folder but again, same results.

Any suggestions anyone?

Apache configuration (relevant lines)
[INDENT]LoadModule php5_module "c:/php/php5apache2_2.dll"
PHPIniDir "c:/php"
AddType application/x-httpd-php .php
DirectoryIndex index.php
[/INDENT]
PHP ini configuration (relevant lines)
[INDENT]extension_dir = "C:\PHP\ext\"
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_mcrypt.dll
extension=php_mhash.dll
extension=php_gd2.dll
extension=php_gettext.dll[/INDENT]
Path
[INDENT]C:\PHP\ext;C:\PHP;C:\MySQL\bin; ...[/INDENT]

    Just done some more tests....

    If I use the libmysql.dll as supplied with PHP, apache reports a warning on startup:
    [indent]PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\ext\php_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0[/indent]
    however if use the libmysql.dll as supplied with MySQL, Apache does not report ANY warnings or errors, but PHP does not load the mysql extension.

    Same result with extension_dir = "C:/PHP/ext/"

    And no, I can't use the dl() function - Apache is configured as multi-threaded.

      Thank you, but no thanks - Installing a product like XAMP is NOT an option here.

      I already have a working Apache exc. the PHP/MySQL problem, and in fact the Apache configuration is rather complex, - multiple virtual hosts, reverse proxing, load-balancing etc. and whilst I can see that XAMP uses the same basic components, getting my existing configuration into XAMP would be a nightmare.

      Assuming XAMP has solved the problem, perhaps someone knows how "they" solved the problem...

        you can copy the important stuff from your httpd.config file (i.e. virtual host, proxing and other settings) into the new one created by xampp & it should be the same, without the nightmare. After that you'd just copy the files you have in your htdocs folder.

          21 days later

          @: have you found a solution for your problem? looks like i have the same one here with the same php, mysql and apache versions 🙁

          and it's really not the first time i set up a WAMP config on my machine (ok, there's always the possibility that i've screwed it up somehow this time)

            Hello,

            do you have any results?

            I have tried it with:
            Apache 2.2.3
            PHP 5.2 final
            MySQL 5.0.27

            Unfortunately I have the same problem.

            (xampp, wamp are not allowed to use here)

              One more comment.

              If I use PHP as CGI module then it works fine:

              ScriptAlias /php/ "d:/Program Files/php/"
              AddType application/x-httpd-php .php
              Action application/x-httpd-php "/php/php-cgi.exe"

              But if I use it as module then I have no mysql.

              LoadModule php5_module "d:/Program Files/php/php5apache2_2.dll"
              AddType application/x-httpd-php .php
              PHPIniDir "D:\Program Files\php"

              All other settings, files, ... are the same.
              Any idea?

                first check that all the relevant .dll are stored in the C:\PHP\ext, manually check they are all present, some might be missing if they are download the dll's (search on google) and make sure they are in there.

                Secondly make sure all the .dll are from the same version, once did this and had a .dll of a different version and caused major problems.

                make sure that the php.ini file with all the appropriate .dll extensions is also saved into your windows/system 32 file.

                  Alright, i have the system up and running now. After all it really looks like i've screwed it up somehow. 😃

                  The problem was simply the extension_directory entry in php.ini:
                  extension_dir = ".;C:/Programme/php/ext"

                  After i've removed the dot directory it worked as expected:
                  extension_dir = "C:/Programme/php/ext"

                  I'm pretty sure the dot directory was OK in earlier versions...

                    Write a Reply...