I have a task script that works perfectly fine if i run it by visiting the php file from my browsers. However, when i attempt to run it via Plesk Task Scheduler it fail with a fatal error unable to load the require()
file.
The require statement is a simple relative path:
require('../../../app.config.php');
the error is:
PHP Fatal error: require(): Failed opening required '../../../app.config.php'
I think this may be related to the include_path
but i don’t know much about it so a bit lost on that one.
Any help would be great!
2
Answers
You need to use absolute path. A different relative path may be produced if a script is called directly or the script is included in another script.
For example:
relative pathes resolved by current directory. Solutions: Get script directory and combine with the relative path, something like: