Wamp PHP CLI

I am running wampserver and cannot use php files in the CLI. Presumably there are two php operating modes, CGI and CLI. I cannot figure out how to enable the CLI, since I do not see php-cli.exe in / wamp / bin / php / php 5.2.6. When I try to execute php scripts, they will not be executed. Does anyone know how to get the CLI to run php scripts using wampserver 2?

Im basically trying to call a bake.php script to open the console for the cake.

+4
source share
3 answers

You must have the php.exe file, which is a version of the CLI. So you can do

php.exe -f phpfile.php 

to run the file using the command line.

+7
source

If you have a problem with environment variables, follow these steps:

  • Go to My Computers
  • Click the Advanced tab
  • Select environment variables
  • Change "path" on system variables with paths to php and console folder pie

Example: C:\wamp\bin\php\php5.2.9-2;C:\wamp\www\cake\cake\console;

NOTE. You will need to change the paths that match yours, also make sure you have one; separation of each path

+5
source

Here is what can help: http://www.devtrench.com/php-command-line-cli-tips/

Important points:

  • If you have already installed php and reinstall it: make sure which version of php you are using from the command line by checking the environment variables in the windows

  • Make sure you are using the correct php.ini file

+1
source

Source: https://habr.com/ru/post/1286162/


All Articles