Jump to content

Does anyone have a PHP.INI file that works with MYSQL on Windows XP?


Recommended Posts

After getting 5.2.2 installed (using php-5.2.5-win32-installer.msi) and running, I still can't get it to see MySql. This installation doesn't have any dist versions of the INI.

 

Also, one of the main pains in the ass with this installation is that it doesn't automatically copy the ini to the windows directory, but it DOES look for it there. That took me an hour to figure out...

Link to comment
Share on other sites

Ok, first of all move any files you have moved outside of the php installation folder back to it. Second step is to add PHP to the Windows Path.

 

NOTE: Make sure you do restart Windows after modifying the path.

 

Third step open the php.ini within your php installation directory and modify the extension_dir directive to be to set to where the ext/ folder is located, example:

extension_dir = "C:/php/ext"

Next scoll down and uncomment the extension=php_mysql.dll line.

 

Save the php.ini and restart your webserver (eg IIS, Apache).

 

Run a script with the following code:

<?php phpinfo(); ?>

Verify that the line that starts with Loaded Configuration File is set to the path of your php installation directory (eg: C:/php/php.ini), if it does scroll down and see if you can see a MySQL heading. If you do the MySQL extension is now enabled and you should be able to use PHP with MySQL.

Link to comment
Share on other sites

I finally fixed it. Not an easy fix. It seems like every time I install php/mysql (about once a year) I have to re-learn all the tricks. The main problem, I think, was not having libmysql.dll in the windows/system32 folder.

 

In the latest php.ini file from 5.2.2 there is no extension=php_mysql.dll line.

 

NEW problem: I can't get the sessions directory to work. I created a folder c:\PHP\sessions, and allowed read/write from within XP, but I still get session errors, such as this from MediaWiki:

 

Failed to write session data (files)....

 

 

Link to comment
Share on other sites

I finally fixed it. Not an easy fix. It seems like every time I install php/mysql (about once a year) I have to re-learn all the tricks. The main problem, I think, was not having libmysql.dll in the windows/system32 folder.

I advise you to re-read my post and follow the steps I mention. Moving files outside of the php folder can cause more problems, espcially when you may want to upgrade PHP in the future. You may forget that you have moved xyz file outside of the PHP installation folder. This is why I advise you to add PHP to the Path that way you do not need to move any files outside of the PHP installation folder, as PHP will automatically check the Path variable upon startup.

 

In the latest php.ini file from 5.2.2 there is no extension=php_mysql.dll line.

Umm, It is in my php.ini. I use the configuration in php.ini-recommended and then rename it to php.ini which will provide all configuration options. Prehaps the Installer generates custom php.ini upon the configuration options you chose during installation. I haven't used the installer in a long time I prefer the zip package.

 

NEW problem: I can't get the sessions directory to work. I created a folder c:\PHP\sessions, and allowed read/write from within XP, but I still get session errors, such as this from MediaWiki:

Make sure you have setup the session.save_path directive to c:\PHP\sessions

Also make sure there is not a semi-colon ( ; ) at the start of the line either. It there is PHP will ignore it. Lines that start with a semi-colon will be considered as comments.

 

NOTE: When ever you make any modification to the php.ini make sure you restart your webserver.

Link to comment
Share on other sites

Hi,

You always found on internet that php zip archive is more recommended then .msi installer.

Few months ago i was also try to install php via install, i was also unsuccessful.

I only advised to every, who interested to learn php and test it on his machine. Download .zip package.

 

Thanks,

Vishal

 

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.