How to Set Multiple PHP Versions in XAMPP

Поділитися
Вставка
  • Опубліковано 20 січ 2025

КОМЕНТАРІ • 165

  • @NeutronDev
    @NeutronDev  2 роки тому +1

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

  • @xeroks646
    @xeroks646 Рік тому +5

    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  Рік тому +1

      Good job! Glad you found it helpful 💜

  • @doms05
    @doms05 8 місяців тому +1

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

  • @oscaralderete8156
    @oscaralderete8156 11 місяців тому +2

    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  11 місяців тому

      Great 💜
      Thanks for sharing!

  • @Recheche_
    @Recheche_ 4 місяці тому +1

    It worked for me! Thanks! I will finally be able to recover an old phpBB2 forum.

    • @NeutronDev
      @NeutronDev  4 місяці тому

      Awesome! 💜
      Best of luck with your project

  • @SadekHassan
    @SadekHassan 2 роки тому +2

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

    • @NeutronDev
      @NeutronDev  2 роки тому +1

      Yup, indeed. Glad you found it helpful 💜

  • @tokemusical
    @tokemusical Рік тому

    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  Рік тому +1

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

    • @NeutronDev
      @NeutronDev  Рік тому

      Did you figure it out in the meantime?

    • @tokemusical
      @tokemusical Рік тому

      @@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  Рік тому +1

      @@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

  • @angele8376
    @angele8376 3 місяці тому +1

    Hi! Thank you so much for sharing! I have a problem. How can i run composer in the second PHP version I've installed? When i run php -v prints the older version installed; the same way, I cant run composer for newest packages.

    • @angele8376
      @angele8376 3 місяці тому

      I mean, the only way is changing every time environment variable? Or I've misunderstood?

    • @NeutronDev
      @NeutronDev  3 місяці тому

      Hey! Changing the environment variable works too. But you can try adding the following in your project's `composer.json` file:
      "config": {
      "platform": {
      "php": "X.X.XX" // your project's PHP version here
      }
      },
      This way you're telling Composer to use that specific PHP version when running the Composer commands.
      Let me know if this works for you!

  • @danielgonzalez9858
    @danielgonzalez9858 Рік тому +1

    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  Рік тому

      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.

  • @alvarojflores
    @alvarojflores Рік тому +1

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

    • @NeutronDev
      @NeutronDev  Рік тому +1

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

  • @akakeyo
    @akakeyo 3 місяці тому +1

    Thanks, you are a life saver, this video has helped me severally.

    • @NeutronDev
      @NeutronDev  3 місяці тому

      Happy to help and glad to hear you found it helpful 💜

  • @mackymccormack8446
    @mackymccormack8446 2 роки тому +1

    This has been invaluable, thank you

    • @NeutronDev
      @NeutronDev  2 роки тому

      Glad you found it helpful 💜

  • @fadzilahnoor-u4i
    @fadzilahnoor-u4i 4 місяці тому

    my xampp currently using php5.3 version . now, i want to use php8.1.29 . just follow the step, but not work. need help please.

    • @NeutronDev
      @NeutronDev  4 місяці тому

      Hey! Did you check the written guide? Link is in the description.

    • @fadzilahnoor-u4i
      @fadzilahnoor-u4i 4 місяці тому

      @@NeutronDev Ya, already follow. But, only one . i need to know in php.ini. all uncomment must have php_xxxx.dll ?

    • @fadzilahnoor-u4i
      @fadzilahnoor-u4i 4 місяці тому

      @@NeutronDev or only use for pdo_mysql?

    • @NeutronDev
      @NeutronDev  4 місяці тому

      For PHP 8.1.29, the extensions in the php.ini file must not have the .dll extension specified.

  • @cloverchips3350
    @cloverchips3350 9 місяців тому

    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 9 місяців тому

      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  9 місяців тому

      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 9 місяців тому

      @@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  9 місяців тому

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

  • @ranganathvadapalli9221
    @ranganathvadapalli9221 Рік тому +1

    Thank you for sharing the knowledge.

  • @ebukacaius
    @ebukacaius 11 місяців тому

    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  11 місяців тому

      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.

  • @hugonews2023
    @hugonews2023 Рік тому

    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  Рік тому

      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_art 7 місяців тому

    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  7 місяців тому +1

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

  • @tokemusical
    @tokemusical Рік тому +1

    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  Рік тому +2

      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 Рік тому

      @@NeutronDev Get it . Thanks 😊👍

  • @aamirsohailkmas
    @aamirsohailkmas 2 роки тому +3

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

    • @NeutronDev
      @NeutronDev  2 роки тому +3

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

  • @vamshikrishnapatel4348
    @vamshikrishnapatel4348 Рік тому

    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  Рік тому +1

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

    • @vamshikrishnapatel4348
      @vamshikrishnapatel4348 Рік тому

      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  Рік тому

      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
    @monikapaliwal9039 11 місяців тому

    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  11 місяців тому

      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.

  • @ibsmiley6313
    @ibsmiley6313 2 роки тому +1

    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 роки тому +1

      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

  • @dubeshshrestha2159
    @dubeshshrestha2159 9 місяців тому +1

    Very Helpful, Thank you

  • @VasudevanS-n2w
    @VasudevanS-n2w 4 місяці тому

    Hi, PHP version changed. Thanks you dude.

    • @NeutronDev
      @NeutronDev  4 місяці тому

      Hey! What is the problem?

  • @sakshyanigam972
    @sakshyanigam972 Рік тому +1

    Great video. Thanks bro

  • @jn2125
    @jn2125 Рік тому

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

    • @NeutronDev
      @NeutronDev  Рік тому

      What do you mean? Can you expand a bit?

  • @amitkumar-jh1jg
    @amitkumar-jh1jg 11 місяців тому +1

    thanks this is excellent . really save my time

    • @NeutronDev
      @NeutronDev  11 місяців тому

      Awesome 💜

    • @amitkumar-jh1jg
      @amitkumar-jh1jg 11 місяців тому

      how do i switch between two versions

    • @NeutronDev
      @NeutronDev  11 місяців тому

      @@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.

  • @thinyadanarsu8122
    @thinyadanarsu8122 Рік тому

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

    • @NeutronDev
      @NeutronDev  Рік тому +1

      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  Рік тому +1

      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  Рік тому +1

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

  • @tahiryasin
    @tahiryasin Рік тому +1

    You are awesome! :)

  • @WaiPinNg
    @WaiPinNg 2 роки тому +1

    works well, thank you so much!!

  • @JayabheriNews
    @JayabheriNews 2 роки тому +1

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

  • @davidmercadojuanes5467
    @davidmercadojuanes5467 Рік тому +1

    Thank u so much man!

  • @leonun
    @leonun 6 місяців тому +1

    amazing, thanks!!

    • @NeutronDev
      @NeutronDev  6 місяців тому +1

      You're welcome 💜

  • @Raza_9798
    @Raza_9798 2 роки тому +1

    Thank you mate this works perfectly.

  • @dalwinderjitsingh1319
    @dalwinderjitsingh1319 2 роки тому +1

    Great Job, thank you very much

    • @NeutronDev
      @NeutronDev  2 роки тому

      Thanks 💜, you are welcome!

  • @shoaibahmed6757
    @shoaibahmed6757 9 місяців тому

    Thank you, it saved my time.

  • @ibsmiley6313
    @ibsmiley6313 2 роки тому +1

    Can each version log into phpMyAdmin?

  • @s7s96
    @s7s96 8 місяців тому

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

    • @NeutronDev
      @NeutronDev  8 місяців тому

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

    • @s7s96
      @s7s96 7 місяців тому

      @@NeutronDev There are no errors but nothing works

    • @NeutronDev
      @NeutronDev  7 місяців тому

      @@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

  • @xznt.
    @xznt. 2 роки тому +1

    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  2 роки тому +1

      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. 2 роки тому

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

    • @NeutronDev
      @NeutronDev  2 роки тому +1

      @@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.

  • @_mazfaa
    @_mazfaa Рік тому

    This is helpful, thank you

    • @NeutronDev
      @NeutronDev  Рік тому

      Glad you found it helpful 💜

  • @AnsaFareed-u1j
    @AnsaFareed-u1j Рік тому

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

    • @NeutronDev
      @NeutronDev  Рік тому

      Oh :(
      Anything I can help you with?

    • @AnsaFareed-u1j
      @AnsaFareed-u1j Рік тому

      ​@@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  Рік тому

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

  • @GodwinAgedah
    @GodwinAgedah 7 місяців тому +1

    Thanks it worked

  • @DeeDeeSRB
    @DeeDeeSRB 2 роки тому +1

    Thank you 🙌🙌

  • @surendraojha3258
    @surendraojha3258 Рік тому

    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  Рік тому

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

  • @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.

  • @johnparayno6658
    @johnparayno6658 2 роки тому +1

    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  2 роки тому +2

      Hi, John! Thank you

    • @johnparayno6658
      @johnparayno6658 2 роки тому +3

      @@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!

  • @crazysheik
    @crazysheik Рік тому

    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.

  • @mostfa-syntax
    @mostfa-syntax 2 роки тому +1

    tahnks help me a lot

    • @NeutronDev
      @NeutronDev  2 роки тому

      Glad you found it helpful 💜

  • @Rasetz
    @Rasetz 2 роки тому +1

    Nice video

  • @riadhcoding
    @riadhcoding Рік тому

    not working

    • @NeutronDev
      @NeutronDev  Рік тому

      What error(s) are you getting?

  • @vatlyvadoisong3
    @vatlyvadoisong3 2 роки тому +1

    thank u very much

  • @GaragePOSSystem
    @GaragePOSSystem 11 місяців тому +1

    thank you

    • @NeutronDev
      @NeutronDev  11 місяців тому

      You're welcome 💜

  • @vamshikrishnapatel4348
    @vamshikrishnapatel4348 Рік тому

    after this my apachi is not working

    • @NeutronDev
      @NeutronDev  Рік тому

      Check the logs and see what's the issue.

  • @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 2 роки тому

    For linux?

    • @NeutronDev
      @NeutronDev  2 роки тому +1

      What do you mean exactly?

    • @diatmikapm3683
      @diatmikapm3683 2 роки тому

      @@NeutronDev how to multiple php xampp for linux

    • @NeutronDev
      @NeutronDev  2 роки тому +1

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

    • @diatmikapm3683
      @diatmikapm3683 2 роки тому +1

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

  • @ondrasek6877
    @ondrasek6877 2 роки тому +1

    thanks!

  • @davidwang401
    @davidwang401 2 роки тому +1

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

  • @Pururin_Purin
    @Pururin_Purin 2 роки тому

    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  2 роки тому +1

      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 2 роки тому

      @@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.

  • @ismailkt7042
    @ismailkt7042 Рік тому +1

    great

  • @jacklindcosta5963
    @jacklindcosta5963 5 місяців тому

    Did not work

    • @NeutronDev
      @NeutronDev  5 місяців тому

      What happened? Did you encounter any errors?

    • @jacklindcosta5963
      @jacklindcosta5963 5 місяців тому

      @@NeutronDev Yes, i had laragon and Xampp 7.4.30 , when i tried this video in xampp , now MySQL server is showing errors and as well as no multiple php is working in xampp

  • @oscarkimondo1142
    @oscarkimondo1142 7 місяців тому +1

    i'm a satisfied camper

  • @crazy_coder
    @crazy_coder 11 місяців тому +1

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

    • @NeutronDev
      @NeutronDev  11 місяців тому

      Yes, already doing that on newer videos ☺

  • @nahombinyam3759
    @nahombinyam3759 2 роки тому +1

    Thanks very much. Im very grateful 👏👏

    • @NeutronDev
      @NeutronDev  2 роки тому

      Aww 💜 glad you found it helpful