views:

2267

answers:

4
+2  Q: 

Wamp PHP CLI

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.

+4  A: 

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.

Tom Haigh
A: 

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

Dreur
+1  A: 

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

Stoosh
Great thought about the EV (Environment Variables), This is the way to get PHP and any Console based applications working without navigating to the directory.
RobertPitt
A: 

You can check this out http://akshayexp.blogspot.com/2010/07/running-php-by-command-line-on-wamp.html