Trying to add PHP 5.2.10 to XAMPP 1.7.2
Posted: 13. September 2009 05:32
Out of curiousity, I'm trying to add PHP 5.2.10 to XAMPP 1.7.2 and I'm just stuck.
I successfully swapped versions out, meaning I replaced PHP 5.3 with PHP 5.2.10 in one experiment,
but trying to add PHP 5.2.10 as cgi just isn't working correctly.
First, I downloaded PHP 5.2.10 and unzipped it to F:/php52/.
I opened the php.ini file in F:/php52/ and changed this line: extension_dir: "F:/php52/ext".
I then edited my hosts file and made this additonal entry:
Next, in httpd-vhosts.conf, I added the following entries:
I create a file named index.php and put it in F:/NEWXAMPP/xampp/htdocs/php5-2 and in it I add:
Next I restart apache and then go to http://localhostb and it says the PHP version is still 5.3.0.
So as an experiment, I commented out the module in /xampp/apache/conf/extra/httpd-xampp.conf and then restarted it.
Now not only does this page show php 5.2.10, but when I go to just http://localhost, it shows the phpinfo file too.
I checked in httpd.conf to verify the loading order and it loads the vhosts AFTER the httpd-xampp.conf, which in theory this should use PHP 5.2.10 instead, but apparently my theory is wrong.
So that's where I'm at and I'm hoping someone smarter than myself can solve this and tell me what I'm doing wrong.
Thanks in advance!
Also, if there's a better way to do this, PLEASE share! I couldn't find anything by searching on the best method. The directories CAN be different too, meaning /xampp/htdocs can be PHP 5.3.0 and I can make another folder elsewhere and that be PHP 5.2.10. I have no idea what my options are, so I'm hoping someone here can enlighten me.
I successfully swapped versions out, meaning I replaced PHP 5.3 with PHP 5.2.10 in one experiment,
but trying to add PHP 5.2.10 as cgi just isn't working correctly.
First, I downloaded PHP 5.2.10 and unzipped it to F:/php52/.
I opened the php.ini file in F:/php52/ and changed this line: extension_dir: "F:/php52/ext".
I then edited my hosts file and made this additonal entry:
- Code: Select all
127.0.0.1 localhostb
Next, in httpd-vhosts.conf, I added the following entries:
- Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot "F:/NEWXAMPP/xampp/htdocs"
</VirtualHost>
<VirtualHost localhostb:80>
ServerName localhostb
DocumentRoot "F:/NEWXAMPP/xampp/htdocs/php5-2"
ScriptAlias /php52/ "F:/php52/"
Action application/x-httpd-php52 "/php52/php-cgi.exe"
AddType application/x-httpd-php52 .php .inc
<Directory "F:/php52/">
<Files "php-cgi.exe">
Allow from all
</Files>
</Directory>
</VirtualHost>
I create a file named index.php and put it in F:/NEWXAMPP/xampp/htdocs/php5-2 and in it I add:
- Code: Select all
<?php phpinfo(); ?>
Next I restart apache and then go to http://localhostb and it says the PHP version is still 5.3.0.
So as an experiment, I commented out the module in /xampp/apache/conf/extra/httpd-xampp.conf and then restarted it.
Now not only does this page show php 5.2.10, but when I go to just http://localhost, it shows the phpinfo file too.
I checked in httpd.conf to verify the loading order and it loads the vhosts AFTER the httpd-xampp.conf, which in theory this should use PHP 5.2.10 instead, but apparently my theory is wrong.
So that's where I'm at and I'm hoping someone smarter than myself can solve this and tell me what I'm doing wrong.
Thanks in advance!
Also, if there's a better way to do this, PLEASE share! I couldn't find anything by searching on the best method. The directories CAN be different too, meaning /xampp/htdocs can be PHP 5.3.0 and I can make another folder elsewhere and that be PHP 5.2.10. I have no idea what my options are, so I'm hoping someone here can enlighten me.