Jump to content

MySQL not loading in PHP


b0rg

Recommended Posts

Hi.

 

PHP does not appear to recognise my MySQL installation. I am experienced with computers, though very much a beginner with PHP and MySQL. I have been following a book, and the instruction has been working until this point. Any help would be much appreciated. Thanks in advance.

 

I have the following configuration installed on an XP platform as a test bed:

 

"Apache HTTP Server 2.2.13 including OpenSSL"

"PHP 5.2.10" (zipped installation, not installer version).

"MySQL Community Server 5.0 (x86)"

 

PHP is installed in C:\php. Default locations for Apache and MySQL.

 

I have taken the following steps as per an instruction I have been given:

 

1. Placed a copy of mysql.dll, and mysqli.dll from the ext sub directory, into c:\php.

 

2. Edited httpd.conf to include the directives:

    "LoadModule php5_module "C:/php/php5apache2.dll" and,

    "AddType application/x-httpd-php .php".

 

3. Placed a copy of php.ini-dist into the windows folder, and renamed to php.ini. Edited to remove semicolon in front of the following lines:

    extension=php_mysql.dll

    extension=php_mysqli.dll

 

b0rg

Link to comment
Share on other sites

Thanks. I did indeed. Thought someone might ask me that, and I'd realised I'd left that off the original message.

 

Perhaps I haven't provided enough information?

 

I did some research of course (here), and found one message that might have pertained, but that didn't work either. Search swamps you with hits when you only have a few key words you can use :)

Link to comment
Share on other sites

I'm not 100% sure why this is now working but I can now see the MySQL section in phpinfo output.

 

I had changed the php.ini line "extension_dir = "C:/php/ext" to be enabled also, so perhaps that was the issue.

 

Thanks for the help. XAMPP looks like a really good idea by the way, so thanks for that info also.

 

I'm not sure how to set this thread to solved, or even if I can, but the issue is definitely now SOLVED!  :D

Link to comment
Share on other sites

Yeah yeah... I like to do things the hard way so I learn ok :)

 

There was no MySQL section before it started working. Everything else in the output looked good though. Must have been a slight misconfiguration.

 

Might still have a look at XAMPP though, so thanks for the tip.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.