Find the answer to your Linux question:
Results 1 to 4 of 4
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2013
    Posts
    2

    Question 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
    Code:
    if(file_exists("php/Alibrary.phb")){
    		include_once("php/Alibrary.phb");
    What I do not understand is that this command works without problem:
    Code:
    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
    Code:
    * * * * * cd /var/www/cron/ && php -f minute.php
    But I checked the conf php and this seems bcompiler present
    php -m
    Code:
    [PHP Modules]
    apc
    bcompiler
    calendar
    Core
    ....
     
    [Zend Modules]
    php -i | grep bcompiler
    Code:
    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!

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,757
    my code runs correctly from the command line php-f but not with crontab?
    Are you sure, you are using absolute path names ?Cron work on absolute path names.

    Try changing this code
    if(file_exists("php/Alibrary.phb")){
    to something like
    if(file_exists("/path/to/the/file/php/Alibrary.phb")){
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  3. #3
    Just Joined!
    Join Date
    Sep 2013
    Posts
    2

    reply

    hi, Thanks for reply.
    Yes I'm sure the command line works fine. When the crontab is launched I received an email with bytecode file phb but not interpreted.

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,757
    Quote Originally Posted by nicolas33770 View Post
    hi, Thanks for reply.
    Yes I'm sure the command line works fine. When the crontab is launched I received an email with bytecode file phb but not interpreted.
    I agree commandline works. But have you tried crontab with absolute path name?

    * * * * * cd /var/www/cron/ && php -f minute.php
    Above entry is wrong. Crontab doesn't know the path of the file minute.php. .You must provide absolute pathname. If your file minute.php is created under directory /var/www/nic/ then -

    the correct crontab entry is

    Code:
    * * * * * cd /var/www/cron/ && php -f /var/www/nic/minute.php
    EDIT : Just saw that your are 'cd' into specific directory before executing the file. May be try this

    * * * * * /path/to/php -f /var/www/cron/minute.php
    Last edited by Lakshmipathi; 09-30-2013 at 09:44 AM. Reason: just saw something
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •