Resolution to "You must have the MySQL PHP module installed" error

seren

Joined: 2002-09-22
Posts: 11
Posted: Tue, 2005-10-04 04:24

This isn't a gallery problem but a PHP problem, but I thought it might help some folks out there. Going through the Gallery 2.0 installation script, I was getting stuck on step 5 with a "You must have the MySQL PHP module installed" error. I'm using Apache2, MySQL 4.1.14, and PHP 5.0.5 under Windows XP.

Main issue:

The short version is: php.ini lies. Though the php.ini included with the PHP distribution states: "Note that MySQL and ODBC support is now built in, so no dll is needed for it", this is a bald-faced lie. If you do not put the line extension=php_mysql.dll in your php.ini, mysql support will NOT be present.

Other issues I encountered:

* DLL path: The file "libmysql.dll" must be in your path. You can change your system path in the System control panel, but you need to restart for it to take effect in my experience. Alternatively you can toss libmysql.dll in C:\Windows with is already in the system path.

* INI path: The php.ini file needs to be in your path. Like the before, you can change your system PATH variable or put php.ini into the C:\Windows folder. If you're running Apache2, you can instead add:
PHPIniDir "C:/php"
to your httpd.conf.

Troubleshooting tips:

* You can see your server info by opening in your browser a php file containing the line: <?php phpinfo(); ?>

* If your "Configuration File (php.ini) Path" section is listed as "C:\WINDOWS\" or anything that doesn't end in "php.ini", it means that PHP can't find your php.ini file. Example:
Bad: C:\WINDOWS\
Good: C:\WINDOWS\php.ini

* Don't restart Apache. Stop it entirely, then start it again. I've had problems with changes not being refreshed otherwise.


Gallery version: 2.0
PHP version: 5.0.5
Webserver: Apache/2.0.54 (Win32)
Database: MySQL 4.1.14
Operating system: Windows XP Pro

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32506
Posted: Tue, 2005-10-04 08:35

thanks :)

could you sign up on codex.gallery2.org ? it would be great if you could add your findings to the windows installation instructions page, if they are missing.
thanks!

Login or register to post comments
seren

Joined: 2002-09-22
Posts: 11
Posted: Fri, 2005-10-07 17:28

Sure. I'll try to get anything that's missing into there.

Login or register to post comments
charlesdf23

Joined: 2005-09-27
Posts: 19
Posted: Sat, 2005-10-08 04:08

I had the MySQL PHP module error as well, which turned out that there were files that weren't linked correctly. For some reason Apache was looking in /usr/lib/httpd/modules, when it should have been looking in /usr/lib64/httpd/modules. Dunno if that helps anyone.

Login or register to post comments
seren

Joined: 2002-09-22
Posts: 11
Posted: Sat, 2005-10-08 18:48

Good find. Could you add your gotcha to the Unix section on the wiki? http://codex.gallery2.org/index.php/Gallery2:Installation

Login or register to post comments
fredriley

Joined: 2005-12-16
Posts: 19
Posted: Fri, 2005-12-16 20:24

I've just now spent over 2.5 hours hitting this error and trying all sorts to fix it, so it was useful to find the above 'fix'. My phpinfo does indeed say "Configuration File (php.ini) Path C:\WINDOWS", so could some kind soul tell me how to fix the config file path in PHP? I've edited the php.ini file to uncomment the mysql DLL extensions, but can't find any mention of "c:\windows" in it.

I love the demo of Gallery 2 and the feature list does seem to be what we need, but I've now spent 5 hours in total trying to get a simple test installation going on two separate Windows machines. On the first one, I had MySQL 5 installed and got the authentication protocol error, which eventually was tracked down via the FAQs on this site, although the fix is pretty damn awkward and I didn't risk it. That's a long time, and much hunting through FAQs, docs, Google, and these fora, simply for a test installation. I'm tempted to write Gallery off as a 'solution' to our needs but having spent this long on it already I suppose I ought to see it through to the bitter end.

However, we need a system to handle bitmaps, vectors and non-image file formats (doc, pdf, swf, etc), and if Gallery can't do this then there's no point continuing. I can't find any format list in the docs, so could someone please tell me if it can handle anything other than bitmaps? Many TIA.

Cheers

Fred

Login or register to post comments
fryfrog

Joined: 2002-10-30
Posts: 3233
Posted: Mon, 2005-12-19 17:30

You might find some useful information about supported file types at http://codex.gallery2.org/index.php/G1-G2_Comparison and/or other places on the codex.

You'd probably have an easier time working with php and apache on linux, windows is known to *not* be easy to get going from scratch. Your php.ini file in c:\windows means that its looking for it there... so put it there. How could you change the location *of* the php.ini file *in* the php.ini file? It is probably some setting in IIS or Apache that is causing it to look there... or something. I don't use windows for web hosting so these are mostly intuitive guesses based on my use of windows and the error.

_________________________________
Support & Documentation || Donate to Gallery || My Website

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32506
Posted: Mon, 2005-12-19 17:37
Login or register to post comments
seren

Joined: 2002-09-22
Posts: 11
Posted: Mon, 2005-12-19 22:01

The easiest way, especially if you just want to get PHP working for a test is to put the "php.ini" file in the C:\Windows directory and restart Apache. The the phpinfo() page should display "C:\windows\php.ini". If you want PHP to find your ini file elsewhere, you'll probably need to adjust your PATH environment variable. See my first post.

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32506
Posted: Mon, 2005-12-19 22:04

did you read the above linked page? it contains a list of supported filetypes. of course not all imagemagick binaries support the same set of mimetypes, it depends on compile options and available shared libraries on your system.

edit: obviously you edited your post. fine then. ignore this post.

Login or register to post comments
fredriley

Joined: 2005-12-16
Posts: 19
Posted: Tue, 2005-12-20 13:47

Thanks to both of you, and sorry for the late reply but I just forgot to look at this thread yesterday. The Features page is excellent and just what I'd been looking for. I did try looking for a feature list from the http://codex.gallery2.org main page, but couldn't find it, so all I had to go on was the Media Gallery feature comparison at http://www.gallery-addons.com/content/view/64/124 and you can never be entirely sure that those sorts of docs are up-to-date, although it's what attracted me to Gallery in the first place.

As for php.ini, it is in c:\windows, but the problem appears to be to do with the compile directory as you've written in the other thread. I'll come back to you on that shortly after I try a few more tests on my laptop.

fryfrog: I normally wouldn't use Windoze for this kind of software, but if Gallery meets our specs for an image repository then it'll be installed on a Joomla installation on a Windoze server, a decision that I had no influence over, I'm afraid. Given the choice I'd no more use Windows on a server than I'd stick my head in food blender.

valiant: I didn't edit my post, honest! I just wrote it and posted.

Cheers

Fred

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32506
Posted: Tue, 2005-12-20 14:00

i was referring to seren and his post from 2005-12-19.

Login or register to post comments
bartma

Joined: 2009-08-01
Posts: 5
Posted: Fri, 2009-08-07 20:54

I tell you I just give up with this whole Gallery Malarkey.
I have tried for 7 whole days to get this thing installed and it is just one hurdle after another, each hurdle taking ages to fix.
I've got this "You must have PHP MySQ" and you know what, I couldn't care less any more.

I've giving up.

Jeez all I wanted was somewhere to show a few pcitures now re-enginner the next moon landing
Desguntled and frustrated from Hamilton

Login or register to post comments