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).
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?
@@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
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.
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!
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
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
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.
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.
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?
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/
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.
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
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.
@@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.
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.
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.
@@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
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)
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. 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.
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
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 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!
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.
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
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.
@@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.
@@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
Post: neutrondev.com/multiple-php-versions-in-xampp/
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
Good job! Glad you found it helpful 💜
Thanks man! it works perfectly. I used to install different xampp versions, just tweaking the config. but this method is much easier. cheers!
You're welcome 💜
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).
Great 💜
Thanks for sharing!
It worked for me! Thanks! I will finally be able to recover an old phpBB2 forum.
Awesome! 💜
Best of luck with your project
For some years ago it was a nightmare :) many thanks! BRAVO!
Yup, indeed. Glad you found it helpful 💜
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?
Hi! I don't currently have access to my PC. I can get back to you in a week.
Did you figure it out in the meantime?
@@NeutronDev Still don't. What I did was setting the include path in the php.ini file. The .htaccess file doesn't work :/
@@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
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.
I mean, the only way is changing every time environment variable? Or I've misunderstood?
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!
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
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.
Thank you! For sharing your resources and knowledge. Be healthy and successful! 👍🏻💪🏻
Thank you, kind sir! Stay healthy and enjoy the ride 💜
Thanks, you are a life saver, this video has helped me severally.
Happy to help and glad to hear you found it helpful 💜
This has been invaluable, thank you
Glad you found it helpful 💜
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.
Hey! Did you check the written guide? Link is in the description.
@@NeutronDev Ya, already follow. But, only one . i need to know in php.ini. all uncomment must have php_xxxx.dll ?
@@NeutronDev or only use for pdo_mysql?
For PHP 8.1.29, the extensions in the php.ini file must not have the .dll extension specified.
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?
also, the php version have been change to 5.6.4, but when i visit to localhost and phpinfo the version doesnt change?
Hey! You have to tell Apache to use PHP 8 for a certain project (see neutrondev.com/multiple-php-versions-in-xampp/#Apache_configuration)
@@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.
Maybe you did not configure it properly. Hard to tell what's wrong without seeing the code.
Thank you for sharing the knowledge.
🫡
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
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.
I have two projects in different php version , how can I do to shift the php version depending that project I´ll work ?
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.
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?
Hey! The solution should work with FastCGI. It doesn't work with Apache 2.0. What errors are you getting?
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??
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/
@@NeutronDev Get it . Thanks 😊👍
Keep it up, you are doing very well.
Just make sure that your video has enough zoom level.
Thank you 💙! That's a valid point. I'm recording on a big screen and the zoom level may sometimes be disproportionate.
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 ?
Yup, XAMPP can handle multiple PHP versions. Follow this tutorial and you're all set.
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
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.
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
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.
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?
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.
@@NeutronDev So, it should also work if I used the newest version?
@@ibsmiley6313 Yup
Very Helpful, Thank you
You're welcome 💜
Hi, PHP version changed. Thanks you dude.
Hey! What is the problem?
Great video. Thanks bro
Thanks! You're welcome 💜
how to switch the PHP version that I want to use?
What do you mean? Can you expand a bit?
thanks this is excellent . really save my time
Awesome 💜
how do i switch between two versions
@@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.
Is also the same that I would like to use laravel projects with different php versions? Can you answer me 🤩?
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.
@@NeutronDev the question you think is right, so how did you run like that in laravel projects ? Like with these steps ?Thanks for answering.
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.
@@NeutronDev your reply is so fast. Thank you for answering.
No problem! Hope you'll get it done and make the most of it 💪
You are awesome! :)
💜
works well, thank you so much!!
Awesome 💜
Great Video... Helped me Lot... Thank You..
Glad you found it helpful
Thank u so much man!
You're welcome 💜
amazing, thanks!!
You're welcome 💜
Thank you mate this works perfectly.
Glad you found it helpful 💜
Awesome! 💪
Great Job, thank you very much
Thanks 💜, you are welcome!
Thank you, it saved my time.
Awesome 💜
Can each version log into phpMyAdmin?
Yes
@@NeutronDev Thank you.
its just show a white page
i already use
can you help me please
Hey! Sounds like a PHP misconfiguration. Did you check Apache and PHP error logs?
@@NeutronDev There are no errors but nothing works
@@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
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)
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.
@@NeutronDev That is correct but can we host the dns server & resolver ourselves so we don't depend on the ICANN?
@@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.
This is helpful, thank you
Glad you found it helpful 💜
It's not working on my system i have tried alot of time.
Oh :(
Anything I can help you with?
@@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?
The whitescreen is due to an error. Could be anything. Have you checked Apache's logs in XAMPP?
Thanks it worked
Awesome 💜
Thank you 🙌🙌
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
Hey! Check the logs and see what error you got.
how can i do that in mac
I didn't try XAMPP on macOS but the principles should be the same.
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?
Hi, John! Thank you
@@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!
how to switch versions ?
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.
tahnks help me a lot
Glad you found it helpful 💜
Nice video
not working
What error(s) are you getting?
thank u very much
You're welcome 💜
thank you
You're welcome 💜
after this my apachi is not working
Check the logs and see what's the issue.
What with 7.4 version? xD Tried with similar steps, but not working xd
Did you download the right php version?
@@NeutronDev yes, 7.4.9 for win. Whats making problem - GD is not ON. But it is, gd and gd2.
Also had problem with openssl and curl. But somehow I managed to fix it. But still GD...
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.
For linux?
What do you mean exactly?
@@NeutronDev how to multiple php xampp for linux
@@diatmikapm3683 I don't have a tutorial for that. Perhaps in the future ^^
Ok.. Ok... Not problem.. Thanks you..
thanks!
You're welcome 💜
Спасибо большое!)))
You're welcome
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
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.
@@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.
great
Did not work
What happened? Did you encounter any errors?
@@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
i'm a satisfied camper
XAMPPER 😂
Please next time you make any video. Zoom your video a little for better view.
Yes, already doing that on newer videos ☺
Thanks very much. Im very grateful 👏👏
Aww 💜 glad you found it helpful