Error running PHP 5.6 with XAMPP 7.4.16

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Error running PHP 5.6 with XAMPP 7.4.16

Postby ricardouel » 16. June 2021 14:23

Hi friends.

I'm setting up a new PHP version on XAMPP 7.4.16 with PHP 7.4.

The version I need to configure is 5.6.40.

I downloaded the NTS version (non thread safe) and unzipped it in the "C:\xampp\php_5.6" folder.

Renamed and configured "php.ini-development" to "php.ini".

I uncommented the "extension_dir" line
extension_dir="C:\xampp\php_5.6\ext".

I added the following lines to httpd-xampp.conf:

#PHP 5.6 on port 8056
##
ScriptAlias ​​/php_5.6 "C:/xampp/php_5.6"
Action application/x-httpd-php56-cgi /php_5.6/php-cgi.exe
<Directory "C:/xampp/php_5.6">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>

Listen 8056
<VirtualHost *:8056>
<FilesMatch "\.php$">
SetHandler application/x-httpd-php56-cgi
</FilesMatch>
</VirtualHost>

I'm getting the following error in apache's error.log when I run the code:

<?php
phpinfo();
?>

Error:
[Wed Jun 16 10:01:11.392174 2021] [cgi:error] [pid 8780:tid 2128] [client 192.168.15.10:60851] End of script output before headers: php-cgi.exe

Can anybody help me?

Best regards.

Ricardo.
ricardouel
 
Posts: 14
Joined: 24. March 2021 19:11
XAMPP version: 7.4.16
Operating System: Windows 8

Re: Error running PHP 5.6 with XAMPP 7.4.16

Postby Altrea » 16. June 2021 16:22

Why don't you Install XAMPP 5.6.40 which already comes with PHP 5.6.40?
You can find it here: https://sourceforge.net/projects/xampp/ ... ws/5.6.40/
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11091
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Error running PHP 5.6 with XAMPP 7.4.16

Postby ricardouel » 16. June 2021 17:55

I already have this infrastructure in PHP 7.4 and other versions of PHP 7.X running perfectly on this XAMPP installation. Now I just need to run PHP 5.6 and I didn't want to have to install 2 versions of XAMPP.

I'm afraid to conflict and ruin what is running perfectly.
ricardouel
 
Posts: 14
Joined: 24. March 2021 19:11
XAMPP version: 7.4.16
Operating System: Windows 8

Re: Error running PHP 5.6 with XAMPP 7.4.16

Postby Altrea » 16. June 2021 20:52

Okay.

I have written a step by step tutorial for this in the german part of this board years ago which should still work.
Maybe this can help you: viewtopic.php?f=4&t=67753&p=232615#p232615
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11091
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Error running PHP 5.6 with XAMPP 7.4.16

Postby ricardouel » 16. June 2021 21:21

I just didn't understand where I should put the clauses of .htacces. In the application directory I want to run in PHP 5.6?
ricardouel
 
Posts: 14
Joined: 24. March 2021 19:11
XAMPP version: 7.4.16
Operating System: Windows 8

Re: Error running PHP 5.6 with XAMPP 7.4.16

Postby Altrea » 16. June 2021 22:26

Yes, you create a .htaccess in the folder which you want to get interpreted by PHP 5.6.40.

It don't need to be a .htaccess, it can also be a virtualhost or Directory section.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11091
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Error running PHP 5.6 with XAMPP 7.4.16

Postby ricardouel » 17. June 2021 13:13

Thanks buddy.

I was able to run PHP 5.6 based on your guidelines as virtual host.

My httpd-xampp.conf was like this:

##
#PHP 5.6 on port 8056
##
ScriptAlias /php_5.6 "C:/xampp/php_5.6"

<IfModule actions_module>
Action application/x-httpd-php56-cgi "/php_5.6/php-cgi.exe"
</IfModule>

<Directory "C:/xampp/php_5.6">
SetEnv PHPRC "C:/xampp/php_5.6"
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>

Listen 8056
<VirtualHost *:8056>
<FilesMatch "\.php$">
SetHandler application/x-httpd-php56-cgi
</FilesMatch>
</VirtualHost>

Best regards.

Ricardo.
ricardouel
 
Posts: 14
Joined: 24. March 2021 19:11
XAMPP version: 7.4.16
Operating System: Windows 8

Re: Error running PHP 5.6 with XAMPP 7.4.16

Postby Altrea » 17. June 2021 17:01

great :D
glad you got it working. 8)
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11091
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 108 guests