Archive | PHP RSS feed for this section

Use cake console with XAMPP

TweetIf 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 PLAIN TEXT CODE: exec php -q ${LIB}cake.php "$@" -working "${APP}" to PLAIN TEXT CODE: exec /opt/lampp/bin/php -q ${LIB}cake.php "$@" [...]

Read full story · Comments { 2 }

PHP array to JSON in CakePHP

TweetIt is an often asked question on the CakePHP google groups, how to pass a php array to javascript. The answer is to convert the PHP array to JSON, I have seen several solutions recommended which included using vendor classes, the PHP 5 extension for JSON - however the recommended way is to use the [...]

Read full story · Comments { 8 }