我試圖使用帶有敏感信息的PHP腳本,所以我正在使用includes來託管webroot上面的密碼。當以cron作業運行時,訪問PHP包含上述webroot
該腳本可以通過瀏覽器正常運行,但是當我將它作爲crob作業運行時,它會生成有關include的錯誤消息。
open_basedir設置是:/ var/www/vhosts/xxx /:/ tmp/- 想知道這裏是否有關?
感謝您提供有關如何解決此問題或解決方法的任何建議。
PHP Warning: include(../includes.php): failed to open stream: No such file or directory in /var/www/vhosts/xxx.com/httpdocs/linkedin_status.php on line 6
PHP Warning: include(../includes.php): failed to open stream: No such file or directory in /var/www/vhosts/xxx.com/httpdocs/linkedin_status.php on line 6
PHP Warning: include(): Failed opening '../includes.php' for inclusion (include_path='.:') in /var/www/vhosts/xxx.com/httpdocs/linkedin_status.php on line 6
PHP Notice: Use of undefined constant API_KEY - assumed 'API_KEY' in /var/www/vhosts/xxx.com/httpdocs/linkedin_status.php on line 88
PHP Notice: Use of undefined constant SCOPE - assumed 'SCOPE' in /var/www/vhosts/xxx.com/httpdocs/linkedin_status.php on line 89
PHP Notice: Use of undefined constant REDIRECT_URI - assumed 'REDIRECT_URI' in /var/www/vhosts/xxx.com/httpdocs/linkedin_status.php on line 91
你是否嘗試爲你的'include'使用絕對路徑?我設法通過這種方式解決類似的問題 – Fabio