Click to run PHP scripts without creating .bat wrappers.
- Extract ClickPHP to a permanent directory, such as:
C:\Tools\ClickPHP
-
Edit
clickphp.iniand configure your PHP installation. -
Add the ClickPHP directory to your Windows
PATHif you want to useclickphpfrom any terminal.
clickphp.ini must be located beside clickphp.exe.
ClickPHP accepts either the PHP executable:
[php]
executable=C:\Tools\php83\php.exeor the PHP installation directory:
[php]
executable=C:\Tools\php83When a directory is specified, ClickPHP automatically uses php.exe from that directory.
You can optionally configure a directory containing scripts you want ClickPHP to find globally:
[scripts]
directory=C:\Tools\PHP-ScriptsRunner behavior can also be configured:
[runner]
pause_on_error=true
pause_after_run=falseclickphp <script> [arguments...]
Run a script in the current directory:
clickphp exampleThe .php extension is optional:
clickphp example.phpArguments after the script name are passed directly to PHP:
clickphp resize --width 800 --recursiveRun an exact path:
clickphp "D:\Tools\example.php"Use:
clickphp --helpfor the complete command-line options and script resolution rules.
The examples/ directory contains additional working examples.
Configuration file not found
Make sure clickphp.ini is beside clickphp.exe.
PHP executable not found
Check the [php] executable setting in clickphp.ini. It must point to either your PHP executable or the directory containing php.exe.
For example:
executable=C:\Tools\php83or:
executable=C:\Tools\php83\php.execlickphp is not recognized as a command
Add the directory containing clickphp.exe to your Windows PATH, or run clickphp.exe using its full path.
Want to build or modify ClickPHP?
See BUILD.md for the development environment, build process, and repository tests.
ClickPHP is released under the Unlicense.
