pyang Posted September 6, 2007 Share Posted September 6, 2007 Hi, I had Apache 2 and MySQL4.1 working fine with PHP4 in my XP box. Now that I'd like to switch PHP from 4 to 5. I then set up PHP5 by unzipping php-5.2.4-Win32.zip to C:\ while keeping PHP4 in the same box. To switch from PHP4 to PHP5, I did the followiings. 1. delete php.ini (originally used by PHP4) in C:\WINDOWS 2. include PHP 5 root dir (C:\php-5.2.4-Win32\) in environmental path. 3. make sure php.ini in PHP 5 root dir has the following entries extension_dir = "C:\php-5.2.4-Win32\ext" extension=php_mysql.dll extension=php_mysqli.dll 4. configure httpd.conf to make sure it has the following entries LoadModule php5_module "C:/php-5.2.4-Win32/php5apache2_2.dll" PHPIniDir "C:/php-5.2.4-Win32/" All dirs look correct. And then I created a simple page <?php phpinfo(); ?> in order to verify PHP5 works with Apache2 and MySQL4.1. However, it shows an blank page. Please note that if I commented out PHPIniDir "C:/php-5.2.4-Win32/" in httpd.conf, I get the attached page in which 2 lines look weired. Configuration File (php.ini) Path C:\WINDOWS Loaded Configuration File (none) Configuration File (php.ini) C:\WINDOWS Loaded Configuration File (none) Can somebody tell me what I'm missing or got wrong? Thanks, Paul [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/68249-having-problem-switching-from-php4-to-php5/ Share on other sites More sharing options...
lemmin Posted September 6, 2007 Share Posted September 6, 2007 Is there a reason you don't just uninstall PHP 4 and install PHP 5? Did you make sure that the path system variable has the right php folder? Quote Link to comment https://forums.phpfreaks.com/topic/68249-having-problem-switching-from-php4-to-php5/#findComment-343100 Share on other sites More sharing options...
pyang Posted September 6, 2007 Author Share Posted September 6, 2007 Hi there, I thought it was not necessary to uninstalled PHP4 as originally I set it up via a zip file. I did do the followings to disabled PHP4. 1. remove the php.ini (used by php4) from C:\WINDOWS 2. remove php4 path from environmental variables and replace it with php5 path 3. copy C:\php-5.2.4-Win32\libmysql.dll, php-5.2.4-Win32\php5ts.dll, php-5.2.4-Win32\php_mysql.dll, php-5.2.4-Win32\php_mysqli.dll to C:\WINDOWS\System32 Together with what I did to set PHP5 up, I think PHP5 should have been enabled. It looks like it from the phpInfo I attached in my original post. Apparently, it says "PHP Version 5.2.4". The real problem now looks like that I still don't get MySQL support enabled. phpInfo doesn't show the MySQL section at all. What's wrong with my setup? Thanks, Paul Quote Link to comment https://forums.phpfreaks.com/topic/68249-having-problem-switching-from-php4-to-php5/#findComment-343139 Share on other sites More sharing options...
lemmin Posted September 6, 2007 Share Posted September 6, 2007 Did you make sure that the path system variable has the right php folder? System Properties > Environment Variables. Quote Link to comment https://forums.phpfreaks.com/topic/68249-having-problem-switching-from-php4-to-php5/#findComment-343176 Share on other sites More sharing options...
pyang Posted September 6, 2007 Author Share Posted September 6, 2007 Hi, Yes, PHP5 path is included in system variables. I did the following to double check. 1. My Computer > Properties > Advanced> Environment Variable. In System variables section, PHP5 root is there, while PHP4 root is not included any more. 2. Open a Command Prompt window, a. without changing directory to PHP5 folder, do echo %PATH% PHP5 is shown as part of the displayed string. b. php -v PHP shows the version number 5.2.4 Based on these, I assume I had the path set up right. phpInfo shows the right PHP5 version too. Thanks, Paul Quote Link to comment https://forums.phpfreaks.com/topic/68249-having-problem-switching-from-php4-to-php5/#findComment-343287 Share on other sites More sharing options...
Davidnorman1 Posted September 15, 2007 Share Posted September 15, 2007 Silly question, but you do have a php.ini file under C:\Windows? PHP will continue to work without php.ini, but only with 'default' values. Also, the files you moved which are pre-fixed php_XXX.dll normally reside in the php extension folder (C:\php\ext?). Try moving these files back, restarting apache and running you php test again I tested this on my server tonight and can confirm that mysql support wasn't loaded after moving these files. Let me know how you get on. Dave Quote Link to comment https://forums.phpfreaks.com/topic/68249-having-problem-switching-from-php4-to-php5/#findComment-349298 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.