21 January 2014

Installing PHP on Linux is straightforward with apt-get or your preferred package management system. Although PHP.net does not provide that uber-simple solution, Microsoft provides a solution for us.

Use the Web Platform Installer to install stable versions of 5.2 or 5.3. On my computer, this installed PHP at C:\Program Files (x86)\PHP\php.exe. Unfortunately, the installer does not update your PATH for trivial command-line usage. To add the path to php.exe into your batch file, add this line:

set PATH=%PATH%;"C:\Program Files (x86)\PHP"

Remember to confirm and adjust the installation folder before adding this 'set' statement to your script.

Update: In a more recent installation, the default profiles did not work. However, selecting PHP for IIS Express did install, and it includes the CLI version.


blog comments powered by Disqus