Answer the question
In order to leave comments, you need to log in
Why is cron executing php at the root?
This problem is more of an aesthetic one.
The hosting has a file in the /www/example.ru/dir/index.php directory.
I run the following command in the hosting crown:
php -f /var/www/vh12345/data/www/example.ru/dir/index.php
Everything works well, but the problem is that the files that the script writes (there txt and jpg) are created in the root directory: /var/www/vh12345/data/
If you do not run through cron, then everything is fine and the files are created in the script directory . How could this be corrected?
Sample code for a file:
if (!copy($pic_file, "picture.jpg")) {
echo "не удалось скопировать $pic_file...\n";
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question