Skip to main content

Problem running cron job

Comments

4 comments

  • cPanelLauren
    Is anything output to the PHP error logs? If you don't have php error logging enabled you should be able to enable it in the php.ini file in your account by adding the following: ; log PHP errors to a file log_errors = on error_reporting = 32767 error_log = /path/to/file
    If you are unsure how to do this or this doesn't work you will need to speak to your provider about enabling it.
    0
  • Christian Tisell
    Hi, tnx for the answer. I have managed to locate the error file and found some errors. It seems that it has to do with the php.ini include_path setting. ( I think!!) This is the error I got in my log file. [29-May-2019 23:50:01 Europe/Stockholm] PHP Warning: require(../config.php): failed to open stream: No such file or directory in /home/xxxxx/public_html/weather/template/update/update.php on line 24 [29-May-2019 23:50:01 Europe/Stockholm] PHP Fatal error: require(): Failed opening required '../config.php' (include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in /home/xxxxx/public_html/weather/template/update/update.php on line 24 [29-May-2019 23:50:01 Europe/Stockholm] PHP Warning: require(../../config.php): failed to open stream: No such file or directory in /home/xxxxx/public_html/weather/template/plugins/meteohub/update.php on line 33 [29-May-2019 23:50:01 Europe/Stockholm] PHP Fatal error: require(): Failed opening required '../../config.php' (include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in /home/xxxxx/public_html/weather/template/plugins/meteohub/update.php on line 33
    My include_path today is .:/opt/alt/php71/usr/share/pear My config.php file is in the directory /home/xxxxx/public_html/weather/template Am I right when I think I have to extend my include_path with one more path? A path to where the config.php file is. Both these scripts have a variable called $base but it differs depending on how deep in the file structure the running scripts are $base = "../"; and $base = "../../"; If I'm right is it enough to put this path to the indlude_path setting /home/xxxxx/public_html/weather/template or do I have to put something else in the settings? Maybe it's not include_path at all that is the problem. I'm a newbie to this so please bear with me and my problems. :) All the best Christian
    0
  • cPanelLauren
    The php documentation on this might be helpful: PHP: set_include_path - Manual It might also be helpful just to confirm what's on line 24 of the file that's noted: /home/xxxxx/public_html/weather/template/update/update.php on line 24
    0
  • Christian Tisell
    Hi again :-) About the scripts that have an error on line 24, it looks like this Row Script 21 $base = "../"; 22 23 // load main info 24 require($base."config.php"); 25 26 // load dependencies 27 require($base."scripts/functions.php"); and so forth... Script with error on line 33 Row Script 30 $base = "../../"; 31 32 // load main info 33 require($base."config.php"); 34 35 // load dependencies 36 require($base."scripts/functions.php"); Have read the man page but still not sure hot to put the path when the variable in one script is one level down and in the other two levels down. Probably it's an "error 40" and I that don't understand. :-) My Include_path look like this now .:/opt/alt/php71/usr/share/pear:/home/xxxxx/public_html/weather/template (what i added in blod) but still same error :-( /Christian
    0

Please sign in to leave a comment.