Windows Command Line – Multiple PHP Versions [closed]

Posted on

Windows Command Line – Multiple PHP Versions [closed] – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about windows, php, command-line-interface, , .

I am currently running Wampserver with multiple PHP versions (5.3.8, 5.4.3). Wampserver easily allows you to switch back and forth between the php version you want apache to use. However, I’m having trouble dealing with multiple versions from the CLI. I have projects that require the command line, but some are compatible with php5.4, while some are not.

Is there a way to create some type of “alias” in Windows that allows me to specify which version of PHP to use on the command line… I.E: php54 cache:clear, php53 cache:clear?

Solution :

The easiest way to do this would be to make use of the ‘PATH’ environmental varibale, and rename the. PHP binaries to be different (if they’re not already). Add both PHP install directories into the ‘PATH’ and they’ll both be searched when you run an executable from the command line, so you won’t have to type out the full path every time. (Of course, since any directory in there will be searched, it’s important you have the different PHP binaries named differently.)

Leave a Reply

Your email address will not be published.