Strange bug crontab command line php / bcompiler

Hello everyone,

I have a small problem that I'm stuck for several days and I do not go out.

I tell you, I have a php script that I want to run crontab, it uses a compiled bcompiler file.

In my php file

if(file_exists("php/Alibrary.phb")){
		include_once("php/Alibrary.phb");

What I do not understand is that this command works without problem:

php -f cron/minute.php

and when my order is executed using the following crontab bcompiler the file is imported into the code but not executed :confused:

* * * * * cd /var/www/cron/ && php -f minute.php

But I checked the conf php and this seems bcompiler present
php -m

[PHP Modules]
apc
bcompiler
calendar
Core
....
 
[Zend Modules]

php -i | grep bcompiler

bcompiler
bcompiler support => enabled
bcompiler version => 1.0.2s
bcompiler.debug => 0 => 0
bcompiler.debugfile => no value => no value
bcompiler.detect_filedir => On => On
bcompiler.enabled => On => On

do you have an idea that would ensure that my code runs correctly from the command line php-f but not with crontab? The file is imported into the code so the roads are good, I is not an error message ... This is the bcompiler party fails to perform include!

The crontab does not run the login files like .profile; certainly an important piece of environment is missing.
A brute force copy of your current environment:

(env; echo "
cd $PWD
umask `umask`
php -f cron/minute.php
") > wrapper.txt

and have the following command in crontab

sh /path/wrapper.sh

with the correct path of course.

thanks for reply, I tried but I has new error:
more wrapper.txt

HOME=/root
OLDPWD=/root
LOGNAME=root
PATH=/usr/bin:/bin
LANG=fr_FR.UTF-8
SHELL=/bin/sh
PWD=/var/www/cron

cd /var/www/cron
umask 0022
php -f minute.php

more /var/mail/nobody

Content-Type: text/plain; charset=UTF-8
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
Message-Id: <20130923080902.3557B698D@box.dev>
Date: Mon, 23 Sep 2013 10:09:01 +0200 (CEST)

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/bcompiler.so' - /usr/lib/php5/20100525+lfs/bcompiler.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/apc.so' - /usr/lib/php5/20100525+lfs/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/rar.so' - /usr/lib/php5/20100525+lfs/rar.so: cannot open shared object file: No such file or directory in Unknown on line 0
/usr/lib/php5/maxlifetime: 10: [: Illegal number:
Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/bcompiler.so' - /usr/lib/php5/20100525+lfs/bcompiler.so: cannot open shared object file: No such file or directory in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/apc.so' - /usr/lib/php5/20100525+lfs/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/rar.so' - /usr/lib/php5/20100525+lfs/rar.so: cannot open shared object file: No such file or directory in Unknown on line 0
1440

Other idea ? With my old code the bcompiler.so lib seems found but not working... :frowning:

I think you copied from the wrong environment.
Ensure that

php -f minute.php

works on the command line. Then create the wrapper.sh from THIS environment!
And, if the current user is "nobody", create the crontab entry as "nobody"!

Thanks, Yes I understand, I tried to do that. The user who launch the crontab is root, but the problem is still here.

It's not about whether their user has sufficient permissions. It's about whether the things they need are in their PATH...

bcompiler seems loaded and the include_once file seems correctly import but not interpreted.