Question

I'm running wampserver and can't seem to use php files in the CLI. Supposedly there are two modes of running php, CGI and CLI. I can't figure out how to enable CLI since I don't see php-cli.exe in /wamp/bin/php/php5.2.6. When I try and execute php scripts they wont run. Does anyone know how to get the CLI running php scripts using wampserver 2?

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

Was it helpful?

Solution

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

php.exe -f phpfile.php

to run a file using the command line.

OTHER TIPS

If your having a problem with environmental variables, here is some steps to fix it:

  1. Go to My Computer properties
  2. Click advanced tab
  3. Click environmental variables
  4. Edit "path" under system variables with the paths to the php and cake console folders

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

NOTE: You will have to change the paths to match yours, also make sure you have ; seperating each path

Here is something that could help : http://www.devtrench.com/php-command-line-cli-tips/

Important points :

  1. If you’ve installed php before, and reinstall it : make sure what version of php you are using from the command line by checking out your environment variables in windows

  2. Make sure you are using the right php.ini file

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top