Page 1 of 1

Trying to add PHP 5.2.10 to XAMPP 1.7.2

PostPosted: 13. September 2009 05:32
by dmphotography
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:
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.

Re: Trying to add PHP 5.2.10 to XAMPP 1.7.2

PostPosted: 18. September 2009 02:38
by rockinon
I am having the same problem because the even the latest version of Joomla does not yet fully support PHP 5.3. It would be nice if there was a patch to add other versions of PHP to XAMPP

Re: Trying to add PHP 5.2.10 to XAMPP 1.7.2

PostPosted: 18. September 2009 06:07
by dmphotography
The best I've come up with so far is blending XAMPP 1.7.1 and 1.7.2 partially together. What I mean is I've configured it to where I install XAMPP 1.7.1 along side of 1.7.2 and change it's configuration to where XAMPP 1.7.1 uses the MySQL database and same htdocs folder as XAMPP 1.7.2.

I then just use the Apache server in XAMPP 1.7.1, which gives me PHP 5.2.8 and if I want to use PHP 5.3, I can simply stop XAMPP 1.7.1 and start XAMPP 1.7.2. All of my information is located in the same place, so it's seamless for the most part. This allows for me to easily transfer completely over to XAMPP 1.7.2 once all of the scripts I use are updated to PHP 5.3 without having to do a lot of transferring, etc.

I could probably even further integrate them by sharing virtual hosts settings and possibly even the Apache configuration file, but I didn't go quite that far. It's a simple solution that works if you're interested.
I posted details here:
http://blog.myownserver.info/2009/09/xampp-1-7-2-with-php-5-2-php-5-3-solution/
I still wish I could solve what I initially was trying to do in this post, but I'm tired of wasting hours and hours with no luck at all. Someone smarter than me will have to work their magic on this one.