Cron Jobs php doesn't load php.ini

时间:2016-02-18 01:24:48

标签: php cron

I'm working with a file in .php that is totally debugged when I lunch it browser.

The problem comes with TERMINAL and cron jobs.

For ex. in the beginning of the php page, I load a database with MySQLi but what I receive back is an error telling "Cannot instantiate non-existing class: mysqli in ...".

The way I run script from cron job file is:

 /usr/bin/php4.4 /[..path..]/dbmoninsprimera.php

I'm almost sure is a matter of php.ini (because MySQLi shouldn't be loaded with server?) but don't really know how to call collectedly all "standard scripts" that are loaded in browser, but clearly are not loaded from command line.

Do you think you can help me?

Thx.

Alberto

UPDATE v. 1.0

here is extract from phpinfo():

php.ini-1 http://esimeconomytools.altervista.org/a.png

php.ini-2 http://esimeconomytools.altervista.org/b.png

php.ini-3 http://esimeconomytools.altervista.org/c.png

更新v.2.0 - 解决方案

我们走了。 一如既往,解决方案比问题更容易。

运行CRON JOB(至少在1& 1服务器上)的正确方法不是:

 /usr/bin/php4.4 /[..path..]/dbmoninsprimera.php

但:

 20 5,11,17,23 * * * php5.5 /[..path..]/dbmoninsprimera.php

关键是我没有用php.ini调用正确的php版本等等。 只需写下:

 20 5,11,17,23 * * * php /[..path..]/dbmoninsprimera.php

不正确。 所以我不得不打电话给#34; php5.5"尽管" php"。

感谢您的时间和关注。 抱歉延误。

阿尔贝托

0 个答案:

没有答案
相关问题