我[根] /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有问题吗?
感谢。工作。 –