WTF ... IS WTF!?
We are a collective of people who believe in freedom of speech, the rights of individuals, and free pancakes! We share our lives, struggles, frustrations, successes, joys, and prescribe to our own special brand of humor and insanity. If you are looking for a great place to hang out, make new friends, find new nemeses, and just be yourself, WTF.com is your new home.

MySQL PHP extension with Apache

Awkward Silence

Perplexed Bemusement
99
0
0
#1
I need help. Basically, i set up my computer (XP Pro) as a web server using IIS.

I installed PHP, MySQL and phpMyAdmin and had it all working. Then i tried changing over to use the Apache server.

Apache works fine with PHP, but when using apache, PHP refuses to load the MySQL module. When i try and access phpMyAdmin, i get the error:

"cannot load mysql extension;
please check PHP configuration"

I havn't changed any of the config files such as php.ini and I've also tried it again in IIS - and it still works fine in IIS. So, it seems to be a problem with PHP loading the extensions when i'm using Apache as the server (the mb_script extension doesnt load either when using apache)

Any ideas?
 

Jung

???
Premium
13,998
2,267
487
#2
It's probably something in php.ini or httpd.conf. A very quick fix would be to remove the seperate installs and download PHP triad. It takes less than 5 minutes to get up and running that way, and all you need to do is edit httpd.conf if your situation requires it.
 

Awkward Silence

Perplexed Bemusement
99
0
0
#3
Thanks Jung, I knew you'd come to the rescue :thumbsup:

I'll give it a try and see how it turns out.
 

Awkward Silence

Perplexed Bemusement
99
0
0
#4
I got it working with all the separate installations (newest version of each). So now its all working. It just needed all of them to be unistalled and a fresh install of each.

One thing though - I cant get htaccess to work to restrict access to phpMyAdmin... so i've have to restrict access to all but 127.0.0.1

When i try using htaccess, the window pops up but doesn't accept the password. This also happens when i set the phpMyAdmin modes to "cookie" or "http" - the login goes in a continuous loop. Ideas?
 

Awkward Silence

Perplexed Bemusement
99
0
0
#6
I've been using htpasswd, but it still wont accept the user name and password. I'm not sure if i have the location of the .htpasswd file correctly specified in the htaccess file though but i have tried it in many different locations.

Also, i read somewhere that because i'm running the apache server on windows, the password has to be encrypted with MD5?

Directory Structure is:

C:\Web Server\Apache2\htdocs

.htpasswd is in the Apache2 folder.

In httpd.conf is:

<Directory "C:/Web Server/Apache2/htdocs/phpMyAdmin">
AllowOverride All
AuthName "phpMyAdmin"
AuthType Basic
AuthUserFile "C:/Web Server/Apache2/.htpasswd"
Require valid-user
</Directory>
Is that correct?
 

Jung

???
Premium
13,998
2,267
487
#7
That looks good... Apache.org says Windows uses MD5 for htpasswd though. (I'm a WIn-Apache newb)

Try this to generate the password.

htpasswd -b -c .htpasswd username password
It should put it in /bin just move the file to the /apache root.


Don't forget to use the limit command either.

<LIMIT GET>
require user whatever
</LIMIT>

Edit: Shouldn't it be C:\dir\dir\ since it's Windows though? You're using forward slashes like in Unix.
 

Awkward Silence

Perplexed Bemusement
99
0
0
#8
httpd.conf:
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
I thought that a bit strange too.
 

Awkward Silence

Perplexed Bemusement
99
0
0
#9
Success! Building the htpasswd from the command line worked. Prevously, I'd tried an online md5 encrypter, but obviously it didnt work.

Thanks for the help Jung :thumbsup:
 

Jung

???
Premium
13,998
2,267
487
#10
It didn't work, because, as far as I know, nix uses an Apache-only MD5 algorithm. Apparenlty the algorithm is different on the Windows version though. I just learned this a few minutes ago... :p

No problem, glad it worked out for you.