How to Set Multiple PHP Versions in XAMPP

Ғылым және технология

By the end of this video, you're going to find out everything you need to know to install multiple PHP versions in XAMPP on a Windows machine.
Article: neutrondev.com/multiple-php-v...
Resources:
windows.php.net/downloads/rel...
gist.github.com/Tynael/e69c02...
================
Connect with me:
================
Twitter: / pelu_carol
Facebook: / neutrondevcom
Instagram: / neutrondevcom
GitHub: github.com/Tynael
Site: neutrondev.com/
Newsletter: neutrondev.com/newsletter/
⏲️ Timestamps ⏲️
00:00 - Intro
00:20 - Brief
00:39 - How to download the right PHP version
02:44 - Configure php.ini
04:31 - Set Windows Environment variable for PHP (if not already)
06:08 - Apache configuration
07:50 - Conclusions
================
#php #xampp #windows

Пікірлер: 147

  • @NeutronDev
    @NeutronDev2 жыл бұрын

    Post: neutrondev.com/multiple-php-versions-in-xampp/

  • @xeroks646
    @xeroks6469 ай бұрын

    I tried your method and it's working perfectly I now have 3 versions of php 7.4, 8.0 and 8.1. Thank you dude you are a life saver

  • @NeutronDev

    @NeutronDev

    9 ай бұрын

    Good job! Glad you found it helpful 💜

  • @mackymccormack8446
    @mackymccormack8446 Жыл бұрын

    This has been invaluable, thank you

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Glad you found it helpful 💜

  • @SadekHassan
    @SadekHassan Жыл бұрын

    For some years ago it was a nightmare :) many thanks! BRAVO!

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Yup, indeed. Glad you found it helpful 💜

  • @alvarojflores
    @alvarojflores Жыл бұрын

    Thank you! For sharing your resources and knowledge. Be healthy and successful! 👍🏻💪🏻

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Thank you, kind sir! Stay healthy and enjoy the ride 💜

  • @doms05
    @doms052 ай бұрын

    Thanks man! it works perfectly. I used to install different xampp versions, just tweaking the config. but this method is much easier. cheers!

  • @NeutronDev

    @NeutronDev

    2 ай бұрын

    You're welcome 💜

  • @ranganathvadapalli9221
    @ranganathvadapalli92216 ай бұрын

    Thank you for sharing the knowledge.

  • @NeutronDev

    @NeutronDev

    6 ай бұрын

    🫡

  • @aamirsohailkmas
    @aamirsohailkmas2 жыл бұрын

    Keep it up, you are doing very well. Just make sure that your video has enough zoom level.

  • @NeutronDev

    @NeutronDev

    2 жыл бұрын

    Thank you 💙! That's a valid point. I'm recording on a big screen and the zoom level may sometimes be disproportionate.

  • @WaiPinNg
    @WaiPinNg Жыл бұрын

    works well, thank you so much!!

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Awesome 💜

  • @JayabheriNews
    @JayabheriNews Жыл бұрын

    Great Video... Helped me Lot... Thank You..

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Glad you found it helpful

  • @sakshyanigam972
    @sakshyanigam9727 ай бұрын

    Great video. Thanks bro

  • @NeutronDev

    @NeutronDev

    7 ай бұрын

    Thanks! You're welcome 💜

  • @dalwinderjitsingh1319
    @dalwinderjitsingh1319 Жыл бұрын

    Great Job, thank you very much

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Thanks 💜, you are welcome!

  • @Raza_9798
    @Raza_9798 Жыл бұрын

    Thank you mate this works perfectly.

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Glad you found it helpful 💜

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Awesome! 💪

  • @_mazfaa
    @_mazfaa11 ай бұрын

    This is helpful, thank you

  • @NeutronDev

    @NeutronDev

    11 ай бұрын

    Glad you found it helpful 💜

  • @DeeDeeSRB
    @DeeDeeSRB Жыл бұрын

    Thank you 🙌🙌

  • @nahombinyam3759
    @nahombinyam3759 Жыл бұрын

    Thanks very much. Im very grateful 👏👏

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Aww 💜 glad you found it helpful

  • @oscaralderete8156
    @oscaralderete81565 ай бұрын

    Works fine, thanx! In my case I preferred to rename the older version (to avoid reset the PHP system environment variable) and keep using /php for the newest one. Something else, when I tryed to launch the Apache server, it never ran. This is because I needed to copy the directory /extras from your older version (something related to browscap.ini file, don't overwrite just copy the missing ones).

  • @NeutronDev

    @NeutronDev

    5 ай бұрын

    Great 💜 Thanks for sharing!

  • @davidmercadojuanes5467
    @davidmercadojuanes54676 ай бұрын

    Thank u so much man!

  • @NeutronDev

    @NeutronDev

    6 ай бұрын

    You're welcome 💜

  • @shoaibahmed6757
    @shoaibahmed67573 ай бұрын

    Thank you, it saved my time.

  • @NeutronDev

    @NeutronDev

    3 ай бұрын

    Awesome 💜

  • @tahiryasin
    @tahiryasin8 ай бұрын

    You are awesome! :)

  • @NeutronDev

    @NeutronDev

    8 ай бұрын

    💜

  • @Rasetz
    @Rasetz Жыл бұрын

    Nice video

  • @leonun
    @leonun13 күн бұрын

    amazing, thanks!!

  • @NeutronDev

    @NeutronDev

    12 күн бұрын

    You're welcome 💜

  • @mostfa-syntax
    @mostfa-syntax Жыл бұрын

    tahnks help me a lot

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Glad you found it helpful 💜

  • @amitkumar-jh1jg
    @amitkumar-jh1jg5 ай бұрын

    thanks this is excellent . really save my time

  • @NeutronDev

    @NeutronDev

    5 ай бұрын

    Awesome 💜

  • @amitkumar-jh1jg

    @amitkumar-jh1jg

    5 ай бұрын

    how do i switch between two versions

  • @NeutronDev

    @NeutronDev

    5 ай бұрын

    @@amitkumar-jh1jg It depends on what "switch" means in your case. If you want a project running on a different PHP version, then set up the Apache httpd configs accordingly. If you want to change the PHP version for your Windows, then go to the PATH variables and edit it from there.

  • @codesaiyan
    @codesaiyanАй бұрын

    Thanks it worked

  • @NeutronDev

    @NeutronDev

    Ай бұрын

    Awesome 💜

  • @davidwang401
    @davidwang401 Жыл бұрын

    Спасибо большое!)))

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    You're welcome

  • @tokemusical
    @tokemusical10 ай бұрын

    Nice! How can I do if want to work in some projects running the old PHP version? Should I delete the environment variables settled in the path??

  • @NeutronDev

    @NeutronDev

    10 ай бұрын

    Hi! You don't have to delete the environment variable set in the PATH. You have to basically duplicate the Apache configuration xampp > apache > conf > extra > httpd-xampp.conf and tell it to use a certain PHP version as shown in the video. Of course, make sure you have installed the PHP version you want to use. You can also refer to the article from where you can copy & paste the code and adjust it to your needs: neutrondev.com/multiple-php-versions-in-xampp/

  • @tokemusical

    @tokemusical

    10 ай бұрын

    @@NeutronDev Get it . Thanks 😊👍

  • @vatlyvadoisong3
    @vatlyvadoisong3 Жыл бұрын

    thank u very much

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    You're welcome 💜

  • @johnparayno6658
    @johnparayno6658 Жыл бұрын

    Hi there Neutron Dev, thanks for this great tutorial. However it didn't worked on my end, but I just noticed something, yours is using "FastCGI" on the server API, mine uses Apache 2.0 Handler, is the fastCGI required for multiple PHP versions?

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Hi, John! Thank you

  • @johnparayno6658

    @johnparayno6658

    Жыл бұрын

    @@NeutronDev No worries pal, I'm grateful you confirmed it's working due to Fast CGI. I'll be setting up mine to use Fast CGI as well, just looking for a tutorial on that. Thanks!

  • @ondrasek6877
    @ondrasek6877 Жыл бұрын

    thanks!

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    You're welcome 💜

  • @user-mw9ui9uj1o
    @user-mw9ui9uj1o5 ай бұрын

    thank you

  • @NeutronDev

    @NeutronDev

    5 ай бұрын

    You're welcome 💜

  • @danielgonzalez9858
    @danielgonzalez98588 ай бұрын

    I want to do the exercises in a head first PHP & mySQL textbook that was published in 2009. But the version of PHP they're using is PHP 5 or 6. Would I be able to download PHP 5 or 6 and run that version locally using the xampp server on my laptop computer? It is for learning purposes only and I do not plan on posting any of the work on an online server

  • @NeutronDev

    @NeutronDev

    8 ай бұрын

    Yes, you can run even PHP 5 or 6. Make sure to also check my article because the settings are a bit different for PHP 5.

  • @ismailkt7042
    @ismailkt7042 Жыл бұрын

    great

  • @tokemusical
    @tokemusical10 ай бұрын

    After doing this my .htaccess file does not work. The file was working in the old PHP with 'php_value include_path "C:/path/..."'. Now it does not work anymore. I tried setting "AllowOverride All" in the .conf file but nothing happened. How to solve?

  • @NeutronDev

    @NeutronDev

    10 ай бұрын

    Hi! I don't currently have access to my PC. I can get back to you in a week.

  • @NeutronDev

    @NeutronDev

    10 ай бұрын

    Did you figure it out in the meantime?

  • @tokemusical

    @tokemusical

    10 ай бұрын

    @@NeutronDev Still don't. What I did was setting the include path in the php.ini file. The .htaccess file doesn't work :/

  • @NeutronDev

    @NeutronDev

    10 ай бұрын

    @@tokemusical I'd need to see what's in the "httpd-xampp.conf" and ".htaccess" file to be able to figure out what's wrong 🤔 Can you gather the code in a private Gist ( gist.github.com/)? Make sure you don't include any private/secret keys or credentials. You can send the link over to my email or here. Other things you may want to double-check or try: 1. Make sure the PHP versions you have are all Thread Safe or Non-Thread Safe. (You can find more info in the article) 2. Make sure the php.ini is correctly configured as mentioned in the article 3. Check .htaccess for any weird redirect/access rules

  • @ibsmiley6313
    @ibsmiley63132 жыл бұрын

    Why use an older version of XAMPP and go up to version 8.x? Can the newest XAMPP be used and go down to 7.x & 5.x?

  • @NeutronDev

    @NeutronDev

    2 жыл бұрын

    Answer to question 1: Picture this scenario: you've been using XAMPP for 3 years and bam! a new PHP version comes out. You don't want to port all the projects to a new XAMPP version just because a new PHP version came out. So what do you do? Better install a new PHP version on the current XAMPP installation. Or, install a new XAMPP with the newest PHP installation. Answer to question 2: Yes.

  • @ibsmiley6313

    @ibsmiley6313

    2 жыл бұрын

    @@NeutronDev So, it should also work if I used the newest version?

  • @NeutronDev

    @NeutronDev

    2 жыл бұрын

    @@ibsmiley6313 Yup

  • @hugonews2023
    @hugonews202310 ай бұрын

    I have two projects in different php version , how can I do to shift the php version depending that project I´ll work ?

  • @NeutronDev

    @NeutronDev

    10 ай бұрын

    Set up the config as shown in the video (you can also consult the written article) and Apache will know what PHP version to use depending on the project you are using.

  • @khalil_art
    @khalil_art2 ай бұрын

    Your solution is working great, but somehow when I try to install PrestaShop, it doesn't work! I've also noticed that the "Server API" is not "Apache 2.0 Handler" but set to "CGI/FastCGI". Could you help me please?

  • @NeutronDev

    @NeutronDev

    2 ай бұрын

    Hey! The solution should work with FastCGI. It doesn't work with Apache 2.0. What errors are you getting?

  • @ebukacaius
    @ebukacaius5 ай бұрын

    I have tried this method but yet, is not showing the current php i want to add. I have php 7.4.4 and wanted to add php 8.1.0 so i can run my laravel project but instead of running am seeing Windows 7.4.33 when i check the phpinfo in my xampp even though i have restarted the xampp severally. Please help

  • @NeutronDev

    @NeutronDev

    5 ай бұрын

    Hey! Would be good to revisit all the configurations and make sure they are correct. You can also read the blog post. It's hard to guess what issue you're facing without seeing the files and their configurations.

  • @vamshikrishnapatel4348
    @vamshikrishnapatel43489 ай бұрын

    sir i have 2 projects to set up one am already working with having php 7.4 another i has to setup 8.1 does both version can handle in a single xampp ?

  • @NeutronDev

    @NeutronDev

    9 ай бұрын

    Yup, XAMPP can handle multiple PHP versions. Follow this tutorial and you're all set.

  • @vamshikrishnapatel4348

    @vamshikrishnapatel4348

    9 ай бұрын

    hello sir i follwed what you said above afte httpd.conf in apachi i gave all paths as of mine now am not able to run apachi @@NeutronDev

  • @NeutronDev

    @NeutronDev

    9 ай бұрын

    Check Apache's logs and see what's the issue. Pay close attention to all the settings shown in the video. You can also read the article if you find it easier to follow.

  • @monikapaliwal9039
    @monikapaliwal90395 ай бұрын

    I followed your all steps but when you check for new version mine is still showing same the old one.. if i enter where php command then it is showing two different paths of php.exe i.e. C:\xampp\php\php.exe C:\xampp\php83\php.exe

  • @NeutronDev

    @NeutronDev

    5 ай бұрын

    Hi! It looks like you've set up two Windows environment variables for PHP. You should have just one. I recommend going with PHP 8.3.

  • @cloverchips3350
    @cloverchips33503 ай бұрын

    hi can i ask if, how i can change it back to the php version. Like i currently use php version 5.6.4 but i want to change it back to php version 8?

  • @cloverchips3350

    @cloverchips3350

    3 ай бұрын

    also, the php version have been change to 5.6.4, but when i visit to localhost and phpinfo the version doesnt change?

  • @NeutronDev

    @NeutronDev

    3 ай бұрын

    Hey! You have to tell Apache to use PHP 8 for a certain project (see neutrondev.com/multiple-php-versions-in-xampp/#Apache_configuration)

  • @cloverchips3350

    @cloverchips3350

    3 ай бұрын

    @@NeutronDev last concern sir. the php version has been changed into php version 5.6.4, but when i visit localhost/phpinfo, it shows php version 8.0.

  • @NeutronDev

    @NeutronDev

    3 ай бұрын

    Maybe you did not configure it properly. Hard to tell what's wrong without seeing the code.

  • @jn2125
    @jn2125 Жыл бұрын

    how to switch the PHP version that I want to use?

  • @NeutronDev

    @NeutronDev

    11 ай бұрын

    What do you mean? Can you expand a bit?

  • @xznt.
    @xznt. Жыл бұрын

    It seems that you know plenty about Xampp, so my question is this, how can we host a custom domain, that is visible on the public level (anyone can reach it) but thru xampp (domain that is not purchased from ICANN)

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Hey! That's a good question. As far as I'm aware, you cannot publicly expose a domain that basically doesn't exist (being unregistered). You can however expose the IP instead. Or better yet, you can register some free DNS / custom domains and use those instead of the IP.

  • @xznt.

    @xznt.

    Жыл бұрын

    @@NeutronDev That is correct but can we host the dns server & resolver ourselves so we don't depend on the ICANN?

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    @@xznt. You'd have to go through a domain registrar or become one 😅. AFAIK, ICANN oversees a set of DNS such as .com, .org & .net. You can use other domains that don't go through ICANN but through other domain registrars. One way or another, you cannot simply become an authority and register your own custom domain without others knowing about it. You can do whatever you want on your localhost or intranet (create custom domains, SMTPS etc) but not on WWW.

  • @thinyadanarsu8122
    @thinyadanarsu8122 Жыл бұрын

    Is also the same that I would like to use laravel projects with different php versions? Can you answer me 🤩?

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Hi! Sorry, I don't understand your question 😬 If you're asking if you can use multiple PHP versions on multiple Laravel projects in XAMPP, then YES. I've ran multiple Laravel projects with different PHP versions for almost 2 years and it worked flawlessly.

  • @thinyadanarsu8122

    @thinyadanarsu8122

    Жыл бұрын

    @@NeutronDev the question you think is right, so how did you run like that in laravel projects ? Like with these steps ?Thanks for answering.

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    The steps are the ones that I went through in this video. You can also check the article as well. The project that I showcased in the video is actually a Laravel project.

  • @thinyadanarsu8122

    @thinyadanarsu8122

    Жыл бұрын

    @@NeutronDev your reply is so fast. Thank you for answering.

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    No problem! Hope you'll get it done and make the most of it 💪

  • @ibsmiley6313
    @ibsmiley63132 жыл бұрын

    Can each version log into phpMyAdmin?

  • @NeutronDev

    @NeutronDev

    2 жыл бұрын

    Yes

  • @ibsmiley6313

    @ibsmiley6313

    2 жыл бұрын

    @@NeutronDev Thank you.

  • @mahdinouira3261
    @mahdinouira3261 Жыл бұрын

    how can i do that in mac

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    I didn't try XAMPP on macOS but the principles should be the same.

  • @surendraojha3258
    @surendraojha32589 ай бұрын

    when I changed my php version then I am getting this error 11:01:07 AM [Apache] Error: Apache shutdown unexpectedly. 11:01:07 AM [Apache] This may be due to a blocked port, missing dependencies, 11:01:07 AM [Apache] improper privileges, a crash, or a shutdown by another method. 11:01:07 AM [Apache] Press the Logs button to view error logs and check 11:01:07 AM [Apache] the Windows Event Viewer for more clues 11:01:07 AM [Apache] If you need more help, copy and post this 11:01:07 AM [Apache] entire log window on the forums

  • @NeutronDev

    @NeutronDev

    9 ай бұрын

    Hey! Check the logs and see what error you got.

  • @sheikmsc
    @sheikmsc Жыл бұрын

    how to switch versions ?

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    What do you mean exactly? If the configs are done correctly, as shown in the tutorial, Apache knows to automatically switch the PHP version when accessing specified domain.

  • @user-up7ci5wp4t
    @user-up7ci5wp4t8 ай бұрын

    It's not working on my system i have tried alot of time.

  • @NeutronDev

    @NeutronDev

    8 ай бұрын

    Oh :( Anything I can help you with?

  • @user-up7ci5wp4t

    @user-up7ci5wp4t

    8 ай бұрын

    ​@@NeutronDev i preform the same steps provided in tutorial but when i run the project in localhost is show white screen. how to resolve id?​

  • @NeutronDev

    @NeutronDev

    8 ай бұрын

    The whitescreen is due to an error. Could be anything. Have you checked Apache's logs in XAMPP?

  • @oscarkimondo1142
    @oscarkimondo1142Ай бұрын

    i'm a satisfied camper

  • @NeutronDev

    @NeutronDev

    Ай бұрын

    XAMPPER 😂

  • @bssssss63
    @bssssss63 Жыл бұрын

    What with 7.4 version? xD Tried with similar steps, but not working xd

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Did you download the right php version?

  • @bssssss63

    @bssssss63

    Жыл бұрын

    @@NeutronDev yes, 7.4.9 for win. Whats making problem - GD is not ON. But it is, gd and gd2.

  • @bssssss63

    @bssssss63

    Жыл бұрын

    Also had problem with openssl and curl. But somehow I managed to fix it. But still GD...

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Do you have the 'gd' & 'gd2' extensions in \xampp\php\ext folder? Are gd & gd2 extensions enabled in php.ini? Remove the ';' in front to enable them.

  • @diatmikapm3683
    @diatmikapm3683 Жыл бұрын

    For linux?

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    What do you mean exactly?

  • @diatmikapm3683

    @diatmikapm3683

    Жыл бұрын

    @@NeutronDev how to multiple php xampp for linux

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    @@diatmikapm3683 I don't have a tutorial for that. Perhaps in the future ^^

  • @diatmikapm3683

    @diatmikapm3683

    Жыл бұрын

    Ok.. Ok... Not problem.. Thanks you..

  • @vamshikrishnapatel4348
    @vamshikrishnapatel43489 ай бұрын

    after this my apachi is not working

  • @NeutronDev

    @NeutronDev

    9 ай бұрын

    Check the logs and see what's the issue.

  • @riadhcoding
    @riadhcoding7 ай бұрын

    not working

  • @NeutronDev

    @NeutronDev

    7 ай бұрын

    What error(s) are you getting?

  • @crazy_coder
    @crazy_coder6 ай бұрын

    Please next time you make any video. Zoom your video a little for better view.

  • @NeutronDev

    @NeutronDev

    6 ай бұрын

    Yes, already doing that on newer videos ☺

  • @Pururin_Purin
    @Pururin_Purin Жыл бұрын

    I tried to install php 7.4.0 so made a php740 map. It is only working in my D:/xampp/php740 folder. I want to use 7.4.0 in my D:/xampp/htdocs/symfony1 folder but its not working there. Still getting php v8. I have configured the directory part from the github paste to: UnsetEnv PHPRC php_flag engine off SetHandler application/x-httpd-php740-cgi

  • @NeutronDev

    @NeutronDev

    Жыл бұрын

    Hello! Is your script alias within the httpd-xampp.conf file looking like this? # PHP 7.4.0 Set-up ScriptAlias /php740/ "D:/Xampp/php740/" Action application/x-httpd-php740-cgi "/php740/php-cgi.exe" AllowOverride None Options None Require all denied Require all granted SetEnv PHPRC "D:/Xampp/php740" Also, if your Symfony project entry point is in the `/public` folder, make sure to specify that in the statement as shown in the video.

  • @Pururin_Purin

    @Pururin_Purin

    Жыл бұрын

    @@NeutronDev this is what i have right now: # PHP 7.4.0 Set-up ScriptAlias /php740/ "D:/Xampp/php740/" Action application/x-httpd-php740-cgi "/php740/php-cgi.exe" AllowOverride None Options None Require all denied Require all granted SetEnv PHPRC "D:/Xampp/php740" UnsetEnv PHPRC php_flag engine off SetHandler application/x-httpd-php740-cgi When i try enter the command "php -v" in my cmd D:\Xampp\htdocs\symfony1> folder i still get version 8.0.5. I have also setup the enviroment variable.

  • @s7s96
    @s7s962 ай бұрын

    its just show a white page i already use can you help me please

  • @NeutronDev

    @NeutronDev

    2 ай бұрын

    Hey! Sounds like a PHP misconfiguration. Did you check Apache and PHP error logs?

  • @s7s96

    @s7s96

    2 ай бұрын

    @@NeutronDev There are no errors but nothing works

  • @NeutronDev

    @NeutronDev

    2 ай бұрын

    @@s7s96 Does the "original" PHP version still work? Did you download the right Non-Thread Safe/Thread Safe and CPU architecture? You can follow along this article and try to debug: neutrondev.com/multiple-php-versions-in-xampp

  • @dubeshshrestha2159
    @dubeshshrestha21593 ай бұрын

    Very Helpful, Thank you

  • @NeutronDev

    @NeutronDev

    3 ай бұрын

    You're welcome 💜

Келесі