K
K
khodos_dmitry2017-04-02 12:06:03
PHP
khodos_dmitry, 2017-04-02 12:06:03

Cron can't find class from included file?

At first I tried to include the file with the class like this:
require_once $_SERVER['DOCUMENT_ROOT'].'/components/DataBase.php';
cron didn't find the file,
then changed it like this:
require_once ' site.ru/components/addbets.php ';
now the file is found, but the class from the file is not found.
Writes the following:
Fatal error: Class 'DataBase' not found in /home/d/diman3q1/site.ru/public_html/components/addname.php on line 13

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Koryukov, 2017-04-02
@MadridianFox

Logically, there is no document_root in php launched from the console

V
Valery, 2017-04-02
@supervaleha

Try calling from __DIR__

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question