logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.




Apache 2.2.2, PHP 5.1.4 and Mysql 5.0.21

 
Post new topic   Reply to topic    Apache Forum Index -> Other Software



View previous topic :: View next topic  
Author Message
jsknight1969



Joined: 19 May 2006
Posts: 4

PostPosted: Fri 19 May '06 23:16    Post subject: Apache 2.2.2, PHP 5.1.4 and Mysql 5.0.21 Reply with quote

I'm having troubles with the mysql module in PHP.....I think. I have Apache 2.2.2, PHP 5.1.14, and MySQL 5.0.21 loaded. Apache and PHP are running fine now thanks to the handler file and information I found on this site. My problem is that the MySQL module doesn't seem to be loading. If I run a page via IIS with the php command phpinfo() in it, I see the mysql module is loaded. If I do the same thing through apache, the mysql module is missing. From a command line, I can run php -i and again I see the mysql module is loading. What gives?

Any suggestions are greatly appreciated.

PS. This is a Windows 2003 server with IIS, Apache, PHP, and MySQL all running locally. I don't think it's a problem with my server. I did download the latest php client and api from mysql and it didn't seem to matter.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2638
Location: Hilversum, NL, EU

PostPosted: Fri 19 May '06 23:25    Post subject: Reply with quote

You enabled the mysql extension in php.ini ?

Steffen
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Sun 21 May '06 9:29    Post subject: Reply with quote

Since you are running MySQL 5+, I believe you need to use the mysqli extension - I might be wrong.

Also, make sure the libMySQL.dll that came from MySQL AB is in the extensions folder.
Back to top
jsknight1969



Joined: 19 May 2006
Posts: 4

PostPosted: Mon 22 May '06 15:22    Post subject: PHP5+ Reply with quote

Thanks for the response. I am using the mysqli connector and it is enabled in the php.ini. I am able to connect to the mysql 5 db using php and IIS, just not with apache 2.2.2 and the ApacheLounge handler that makes Apache work with PHP 5.1.x. The phpinfo() command via apache does not show the mysql module loaded like it does using IIS and command line.

Maybe some more information about the app I am trying to run will help. I am trying to install OS Commerce. After the database information page where you supply the mysql server name, u/p, and database, the install application freezes. No error messages....nothing. I am assuming that it's having trouble connecting to the db, but only because I don't see the module being loaded in the phpinfo() command. I am going to try some other test pages (hopefully today) and really get into the db connections.

Please keep the suggestions coming. Thanks.
Back to top
jsknight1969



Joined: 19 May 2006
Posts: 4

PostPosted: Mon 22 May '06 19:18    Post subject: Latest update Reply with quote

I wrote a test page that performs a mysql_connect and a simple query to the user table in the mysql db. Using IE, I first tried the page in IIS....it worked great. The db connection was made and my query data was posted to the browser window. I copied the page to apache and tried it again. I get the following error.....Call to undefined function mysql_connect().

I'm at my wits end with this one. PHP.ini is in my windows folder so both Apache and IIS are using the same PHP configuration. I verified this using PHPINFO(). It seems to me that Apache isn't loading the php_mysql extensions.

My next step is to try older version of PHP and Apache, unless someone has some suggestions.

Thanks.
Back to top
jsknight1969



Joined: 19 May 2006
Posts: 4

PostPosted: Mon 22 May '06 21:48    Post subject: User error Reply with quote

After much fooling around, I have found the answer to my problem. It turns out that the PHPINIDIR setting in Apache was incorrect. I guess that PHP was loading some default settings. Once I corrected the PHPINIDIR setting, everything started working fine.

Thanks to everyone who replied and thanks to this forum and it's author for suppling the apache 2 handler.
Back to top
Vile!



Joined: 23 Jun 2006
Posts: 5

PostPosted: Fri 23 Jun '06 23:38    Post subject: Reply with quote

Had the same sympthoms. I used the instaler package which instaled the php.ini into my windows directory. Which I properly set in the httpd.conf. The problem was, that it still did not work. So I checked here, found this thread and figured that php.ini still didn't work despite the fact that everything was set correct.

Using the non-instaling zipped version of php solved my problem... Now the php.ini is located in the PHP directory, phpinidir is set there too and everything works just fine.

But getting it all together is realy wicked-sick IMHO. I mean... First you can't get apache working with php and then php with MySQL. What's the problem with the new versions anyway? Everything worked just fine in the old versions.. And gawd i swear that the instaler versions are the worst...
Back to top
Vile!



Joined: 23 Jun 2006
Posts: 5

PostPosted: Sat 24 Jun '06 2:50    Post subject: Reply with quote

Ok, so I was wrong - still doesn't work.

So I checked the versions: MySQL 5.0.22, Apache 2.2.2 and PHP 4.4.2 + steffens workaround php5apache2.dll-php5.1.x + the C++Redistributable Package to make it work + php_5.1.4_mysql_5.0.22 connector. Still not working..

Weird. So I cross checked the forum, just to find 5 or so threads having similar problems. In most of them steffem says something like "put your libmysql.dll into your windows folder" And people reply things like "It worked" or "I had to put it into the system32 folder" and so on and so forth. So I experimented a litle bit and moved it around "probable" folders and restarted apache now and then - to no awail, everytime I get a "PHP Startup: Unable to load dynamic library 'D:\Server\PHP\php_mysql.dll' - The specified module could not be found." error message in the apache log. So instead of asking for help.. I'l rather as WHY? Why should that dumb file be where and how do I find out where it belongs? It's just too sick if it works differently for everyone. And if that's not the problem (which I'm starting to doubt after actualy having a copy of that file in every of those folders(yes, at once)) what else could it be?
Back to top
Vile!



Joined: 23 Jun 2006
Posts: 5

PostPosted: Sat 24 Jun '06 9:58    Post subject: Reply with quote

OH MY GOD. Smile I managed to kick the whole thing into submission... And this is how I did it (for those that are interested).

I used filemon and found out, that apache's not realy missing libmysql.dll nor php_mysql.dll in that matter... The connectors where fine and... relatively well place because apache ONLY searched like 3 or 4 places before finding them..... The files that httpd.exe couldn't find anywhere where wsock32.dll and mswcrt71.dll. So um... I just fed em to httpd... Copied those right into apache's bin directory. Afterwards it started to workd just fine...

And what does that mean for a newbie with zounds of trouble when trying to instal apache, php, mysql? Simple... It means that the fastest way to get theese things running is to find out what they're missing with filemon and spoon-feed it to them.

GAWD, next time I'm instaling theese I'm putting all the binaries and dll's into the apache bin.... Apache's simply searching for everything in there... I mean realy - httpd.conf says: use the php5apache.dll from d:\server\php - and what does apache do? He searches for it in d:\server\apache\bin. And once he doesn't find it there THEN he finaly starts to search in d:\server\php.

Does anyone else actualy find this stupid a/o possibly malevolent?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2638
Location: Hilversum, NL, EU

PostPosted: Sat 24 Jun '06 13:28    Post subject: Reply with quote

Vile!, where did you download Apache 2.2.2 ? The versions from ASF and here does not need msvcrt71.dll.


Steffen
Back to top
Vile!



Joined: 23 Jun 2006
Posts: 5

PostPosted: Thu 29 Jun '06 17:28    Post subject: Reply with quote

From one of the official mirrors. apache.tuke.sk if I recal correctly.

Looking at your post I'm realy start to feel like verificating those files wouldn't be such a bad idea afterall.

Ehm.
Back to top
xfezz



Joined: 03 Jul 2006
Posts: 1

PostPosted: Mon 03 Jul '06 22:25    Post subject: Reply with quote

Hi, guys I am having the same problem. I am trying to get Apache 2.2.2, php 5.1.4 and mysql 5.0.22 running on windows xp pro. I have apache 2.2.2 and php 5.1.4 installed and running with the handler I found on here. I have also installed mysql 5.0.22. The service is up and running (that I know of with no errors) But I dont know if its working with php or apache.

Has anyone found a work around that they could give me some steps to follow to make sure its working correctly? I have tried everything mentioned in this thread but im still not sure if its running correctly. I have found a few guides but they seem a bit outdated. They showed a section dedicated for mysql on php info page and im not seeing any of that. I presume the extentions isnt being loaded correctly?

in the php.ini I directed the extention to the propper php\ext\ folder. But I dont know where to go from there.


UPDATE

I got it work. This is what I did.

Make sure these 3 files are in your php folder (php.ini, libmysql.dll, php_mysqli.dll) Edit php.ini to enable the mysql extension, and re-boot.

works fine for me atm. we shall see
Back to top
Millennium



Joined: 17 Apr 2006
Posts: 179
Location: Leiderdorp, NL, EU

PostPosted: Thu 13 Jul '06 19:19    Post subject: Reply with quote

Vile! thank u

This problem was driving me mad since 30 apr '06.
Let me share some thoughts.

first wsock32.dll wasn't needed on my server cause it was in my system32. And Apache would find it.

Second. The bloody PHP connector at dev.mysql.com is compiled with msvcr71.dll and is needed to get it work. It was on my system in the .NET framework 1.1 directory. After copy-ing it to the apache bin (or any folder in your path) it worked.
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Other Software
Page 1 of 1