Use cake console with XAMPP

If you have problem while running cake console scripts for your LAMPP installation and get an error like './cake: line 34: exec: php: not found', fix this problem by editing 'cake' shell script and changing line

CODE:
  1. exec php -q ${LIB}cake.php "$@" -working "${APP}"

to

CODE:
  1. exec /opt/lampp/bin/php -q ${LIB}cake.php "$@" -working "${APP}"

This will call the installed 'php' binary from LAMPP installation and you can use the cake console scripts without any problem

About Amit Badkas

Amit Badkas is Zend certified PHP5 and Zend Framework engineer, and has been working in SANIsoft for past 9 years, his present designation is 'Technical Manager'

2 Responses to Use cake console with XAMPP

  1. Geoff Ford June 25, 2007 at 8:38 am #

    Or you could add /opt/lampp/bin/ to your shell path. Not sure on the actual linux command. (I work on a Mac mostly). I explained this in my post about Bake on MAMP

    This way if you ever upgrade (however unlikey) you aren't going to kill your modification.

    Besides, it allows other scripts to be executed on the command line, such as unit tests or cron jobs etc

  2. Amit Badkas June 25, 2007 at 11:10 am #

    Yes, we can also do the same thing your way. On linux, you have to edit your bash_profile file (/home/username/.bash_profile) and add/edit the path there, like I have changed the PATH from PATH=$PATH:$HOME/bin to PATH=$PATH:$HOME/bin:/opt/lampp/bin

    Thanks

Leave a Reply