我[根] /includes/helpdesk/pipe.php與此代碼:如何在管道腳本中使用相對路徑(../)?
#!/opt/cpanel/ea-php55/root/usr/bin/php
<?php
require_once("pipeprocess.php");
在相同的位置在第一線pipeprocess.php我包括在相同的位置仍然另一個文件:helpdesk.php
然後在第一行[根] /includes/helpdesk/helpdesk.php我有:
require_once ("../../config.php");
的config.php是在[根],這就是爲什麼我有兩次.. /../,helpdesk.php可以正常工作t訪問,但如果通過管道命令設置在cPanel中運行pipe.php,我會得到一個反彈錯誤,該配置。 php找不到:
PHP Warning: require_once(../../config.php): failed to open stream: No such file or directory in /home/[user]/public_html/[root]/includes/helpdesk/helpdesk.php on line 21
Warning: require_once(../../config.php): failed to open stream: No such file or directory in /home/[user]/public_html/[root]/includes/helpdesk/helpdesk.php on line 21 PHP Fatal error: require_once(): Failed opening required '../../config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/[user]/public_html/[root]/includes/helpdesk/helpdesk.php on line 21
Fatal error: require_once(): Failed opening required '../../config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/[user]/public_html/[root]/includes/helpdesk/helpdesk.php on line 21
爲什麼我得到這個管道錯誤,因爲直接訪問helpdesk.php工作正常? pipe不接受../或../../作爲路徑的一部分嗎?或者是否有EasyApache4問題?我做了幾個測試,並注意到這是因爲../作爲包含路徑的一部分。 Pipe/EasyApache4有問題嗎?
感謝。工作。 –