Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 474
Graham Avatar asked Dec 13 '22 04:12

Graham


2 Answers

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.

like image 108
Tom Haigh Avatar answered Jan 06 '23 03:01

Tom Haigh


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

like image 22
Stoosh Avatar answered Jan 06 '23 03:01

Stoosh