XAMPP with PHP 7.4.1 & PHP 8.0.1

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

XAMPP with PHP 7.4.1 & PHP 8.0.1

Postby ozh » 01. February 2021 12:09

Hello there

I have a functional XAMPP setup with Apache 2.4.46 and PHP 7.4.1

I downloaded the latest with PHP 8.0.1, hoping to
* have two PHP directories, /xampp/php (with 7.4) and /xampp/php8 (with 8.0)
* be able to switch between these two (rename php to php7, rename php8 to php, restart Apache).
The two php.ini are identical.

From the CLI, it works fine and I can run either 7.4 or 8.0

But from XAMPP Control,
* Works fine with PHP 7.4.1
* When I try with PHP 8.0.1, all I get is the usual and not helping :
12:08:36 [Apache] Attempting to start Apache app...
12:08:36 [Apache] Status change detected: running
12:08:36 [Apache] Status change detected: stopped
12:08:36 [Apache] Error: Apache shutdown unexpectedly.
12:08:36 [Apache] This may be due to a blocked port, missing dependencies,
12:08:36 [Apache] improper privileges, a crash, or a shutdown by another method.
12:08:36 [Apache] Press the Logs button to view error logs and check
12:08:36 [Apache] the Windows Event Viewer for more clues
12:08:36 [Apache] If you need more help, copy and post this
12:08:36 [Apache] entire log window on the forums


So, I guess it's not just the php.ini and the php.exe but something tied to the Apache config itself.

Any clue on what I should check for ?
ozh
 
Posts: 2
Joined: 01. February 2021 12:01
XAMPP version: PHP 7.4.1
Operating System: Windows 10

Re: XAMPP with PHP 7.4.1 & PHP 8.0.1

Postby Nobbie » 01. February 2021 20:32

ozh wrote:Any clue on what I should check for ?


Of course not, as you said:

"all I get is the usual and not helping"

Same for us.
Nobbie
 
Posts: 13179
Joined: 09. March 2008 13:04

Re: XAMPP with PHP 7.4.1 & PHP 8.0.1

Postby Altrea » 01. February 2021 22:20

Hi,

Please start here and try again providing all needed helpful information to identify your specific issue:
[Q&A] Insufficient debug information - Apache starting issue
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: 11941
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

XAMPP with PHP 7.4.1 & PHP 8.0.1 [solved]

Postby ozh » 03. February 2021 22:11

Hello all,

If it can be helpful to anyone, here is how I managed to have a fully functional XAMPP install where I can switch back and forth between PHP 7.4 and 8.0

Step 1: install XAMPP 7.4.1, make it work :)
At this point you have C:/yourdir/xampp and in particular C:/yourdir/xampp/php and C:/yourdir/xampp/apache/conf/extra

Step 2 : download XAMPP 8.0.1, as a zip archive, not a self executable install
Don't install it.
Instead,
- extract the content of the xampp/php directory and put it in C:/yourdir/xampp/php8
- extract the file xampp/apache/conf/extra/httpd-xampp.conf and copy it to C:/yourdir/xampp/php and C:/yourdir/xampp/apache/conf/extra/httpd-xampp8.conf

Step 3 : edit C:/yourdir/xampp/php8/php.ini and modify the paths (eg replace all default \xampp with \yourdir\xampp).
If applicable edit this C:/yourdir/xampp/php8/php.ini to match your functional C:/yourdir/xampp/php/php.ini other settings.

Step 4 : edit C:/yourdir/xampp/apache/conf/extra/httpd-xampp8.conf and modify the default paths again
(Do not simply copy all conf from the existing httpd-xampp.conf file, as some directives change names)

Step 5 : job done, now you have 2 functional installs.

To switch :
- Run xampp-control.exe and start Apache : you're running PHP 7.4.1 as previously.
- Stop Apache
- Switch the two PHP directories :
---- Rename C:/yourdir/xampp/php to C:/yourdir/xampp/php7
---- Rename C:/yourdir/xampp/php8 to C:/yourdir/xampp/php
- Switch the two Apache config files :
---- Rename C:/yourdir/xampp/apache/conf/extra/httpd-xampp.conf to C:/yourdir/xampp/apache/conf/extra/httpd-xampp7.conf
---- Rename C:/yourdir/xampp/apache/conf/extra/httpd-xampp8.conf to C:/yourdir/xampp/apache/conf/extra/httpd-xampp.conf
- Start Apache : you're running 8.0.1

At least, here is how I did and it works for me :)
ozh
 
Posts: 2
Joined: 01. February 2021 12:01
XAMPP version: PHP 7.4.1
Operating System: Windows 10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 116 guests