Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Arrrgghh! PHP will NOT load mysql module

Options
  • 29-07-2008 3:21pm
    #1
    Registered Users Posts: 462 ✭✭


    Anyone got any ideas on this...

    my installation of PHP5 wont load either the php_mysql.dll or php_mysqli.dll

    I checked phpinfo() to make sure the right php.ini is loaded (windows/php.ini) and it is I even turned on and off a fe settings to make sure the changes were reflected in the settings output.

    I have the two files copied to c:\php and they are still in the ext folder too and I have enabled one then the other in php.ini to include them.

    I also have libmysql.dll in the php root folder and have tried changing the path to the absolute address of the root and ext folders (also tried with the default).

    I have been restarting apache every time to no avail. I used the exact same files and process to install on a different computer with problem.

    Anybody got any ideas?


Comments

  • Registered Users Posts: 1,512 ✭✭✭stevire


    Did you copy the mysql library from the root of the PHP5 installation
    directory into your windows/system32 directory?

    What version of MySQL you using? I had this problem a couple of months ago... For MySQL 4.1 and above, load php_mysqli.dll, and change all the "mysql"
    functions in your scripts to "mysqli" functions.


  • Registered Users Posts: 462 ✭✭lunacyfoundme


    mysql 5. not at programming stage still trying to see if the module loads so that its listed in phpinfo.

    just tried copying the php root folder and php.ini from the working pc to the new one and its still not loading... confused!


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Did you copy libmysql.dll from PHP folder to C:\windows\libmysql.dll


  • Registered Users Posts: 462 ✭✭lunacyfoundme


    no copied it to system32 ill try the windows folder and see if that helps.


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    I can't think of anything else myself, but if all else fails, you could download and install Xampp. Installs php5 and mysql5 with just a few clicks.


  • Advertisement
  • Closed Accounts Posts: 81 ✭✭dzy


    no copied it to system32 ill try the windows folder and see if that helps.

    Its probably not able to load a library that it depends on. When this happens I use a free tool called Dependency Walker to detect the dependencies of a library and show the ones that could not be loaded. Search for it on the web and you'll find it easily.


  • Registered Users Posts: 4,386 ✭✭✭EKRIUQ


    Did you reset apache turn it off and on. I wasted a lot of time a while ago banging my head against the desk over this


  • Registered Users Posts: 44 eamonnfallon


    I had the same problem myself today. The problem is that Apache 2.2 doesn't reload the System Path variable when you just do a restart, you have to full restart of the machine. Basically, my problem was that Apache had an older version of mysql in the Path.

    As a sanity check make a file called phpinfo.php with the following:
    <?php
            phpinfo();
    ?>
    

    You should see something like the following in the apache environment path:
    C:\php\php-5.2.6-Win32;C:\Program Files\MySQL\MySQL Server 5.0\bin
    

    You should also see a table titled Mysql


    In your php.ini you should set:
    extension_dir = "C:/php/php-5.2.6-Win32/ext"
    

    Make sure you uncomment:
    extension=php_mysql.dll
    


    Finally make sure your http.conf has:
    LoadModule php5_module "C:/php/php-5.2.6-Win32/php5apache2_2.dll"
    AddType application/x-httpd-php .php
    PHPIniDir "C:/php/php-5.2.6-Win32"
    

    Note its php5apache2_2.dll instead of php5apache2.dll, its easy to miss that if you are just scanning through install.txt


  • Registered Users Posts: 462 ✭✭lunacyfoundme


    the 'PATH' section for apache readout of phpinfo() only says the following:

    C:\Program Files\PC Connectivity Solution\;C:\ORANT\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem\

    Im using apache 2 so the apache conf file is ok. PHP runs fine just wont load mysql dll. I know this cause it doesnt show up in phpinfo(). MYSQl is ok too c ause I can log in by command line. also tried reinstyalling ewveryhing and restarting entire machine no luck

    <quote>
    I use a free tool called Dependency Walker to detect the dependencies of a library
    </quote>
    what file should i be loading with this Ive tried all the php exe files in c:\php no mention of the mysql dlls

    gonna try xampp see if that works.


  • Registered Users Posts: 3,401 ✭✭✭randombar


    Ya seriously xampp is the way to go, no hassle involved in it!


  • Advertisement
  • Registered Users Posts: 462 ✭✭lunacyfoundme


    Just installed xampp in like 2 mins. Its all I need plus more. Total genius! Thanks for the tip Mirror


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    No problem! Spread the word, too many people still going through the pain of manual set up, as I did a few years back! And the amount of times I've reinstalled it, well I'd probably have gone mad without it :)


  • Closed Accounts Posts: 81 ✭✭dzy


    what file should i be loading with this Ive tried all the php exe files in c:\php no mention of the mysql dlls?

    Just drop php_mysql.dll from the 'ext' directory into Dependency Walker. It'll tell you what it can't load.


Advertisement