Thursday, June 12, 2008

Starting PHP CLI with custom PHP.ini

If you HTTP server PHP configuration is different from PHP command line configuration and this prevents you from using PHP CLI, you can resolve this by creating different version of the PHP.ini and specify it when you call the PHP.exe from the command line. You can specify the PHP.ini in one of the following ways:
  • Using PHPRC environment variable. This tutorial will help you to modify environment variables on Windows.
  • With -c command line PHP.exe switch as follows:
    C:\> C:\PHP5\php.exe -c C:\PHP5\PHP.CLI.ini script.php

No comments: