简体   繁体   中英

php cron jobs working fine on cPanel server but giving errors on non cPanel server

I have 2 server one is with cPanel and other is without cPanel

i am running same php scripts as cron jobs on both servers.

All scripts are running fine on cPanel server but on non-cPanel server i am getting file not found error

Failed opening required '../includes/config.php'

i have 15+ cron job php scripts.

is there any way to fix this without editing all my php scripts and adding __FILE__ on all includes and required?

how all these scripts running fine on cPanel without __FILE__?

cron可能需要从其目录中运行脚本。您可以将crontab更新为cd到脚本目录,然后执行它,例如(示例):

0 12 * * * cd /path/to/your/script/ ; php your_script.php > /dev/null 2>&1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM