Search code examples
phpcakephpunixcakephp-bake

Multiple PHP and console warnings when using Bake in Cake


guys.

I've been trying to bake some models, controllers, and views in CakePHP 1.3 - however, when I run the command from console, I've been running into a lot of warnings and unexpected behavior. For instance, if I attempt to bake a model with associations, it fails the first time )and echos a PHP error into the generated model file); if I bake it again, it works correctly.

A lot of these warnings have to do with user permissions (especially for Cake's tmp cache) - unfortunately, my host is using a SunOS box with Solaris ACLs, so the running is a bit rough there. However, it's the other messages that I've been worried about:

sh: /usr/local/php/bin/clear: not found

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/apc.so' - ld.so.1: php: fatal: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/apc.so: open failed: No such file or directory in Unknown on line 0
PHP Warning:  set_time_limit(): Cannot set time limit in safe mode in ~/cakephp_1.3/cake/console/cake.php on line 133
PHP Warning:  fopen(~/cake_apps/tmp/cache/persistent/cake_core_file_map): failed to open stream: Permission denied in /web2/web/floridasadd.org/cakephp_1.3/cake/libs/file.php on line 152

(Please note that I have replaced my home directory with ~, where applicable, for security reasons.)

Has anyone run into this before? It's kind of a strange issue, compounded by the Solaris ACLs. Additionally, my home directory is in a chroot jail, but it's only in effect for the http daemon. (My shell access isn't locked in - I would imagine that programs I run under my UID aren't locked in, either.)

I know that this question is a little haphazard, but I'm really looking for anyone who has had a similar experience with Cake's Bake script. I'm not really sure where to go here. Does anyone have any ideas or experience to share with me? I would greatly appreciate it.


Solution

  • Looks like your PHP CLI is running in safe mode, hence the errors. Try setting safe_mode = off in PHP CLI php.ini (you can find it via php --ini in shell).