benphp Posted January 25, 2008 Share Posted January 25, 2008 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... Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 25, 2008 Share Posted January 25, 2008 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. Quote Link to comment Share on other sites More sharing options...
benphp Posted January 25, 2008 Author Share Posted January 25, 2008 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).... Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 25, 2008 Share Posted January 25, 2008 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. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 25, 2008 Share Posted January 25, 2008 The .msi installer version only puts in a line when you add/remove an extension. Every time I have seen someone trying to use the .msi installer, they were unhappy. I recommend using the .zip package and manually installing php. Quote Link to comment Share on other sites More sharing options...
vishal99 Posted January 27, 2008 Share Posted January 27, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.