我收到此错误
Warning: include(../config.php) [function.include]: failed to open stream: No such file or directory in /home/soizastu/public_html/cms/happy-api/retrieve.php on line 2 Warning: include() [function.include]: Failed opening '../config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/soizastu/public_html/cms/happy-api/retrieve.php on line 2 Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'soizastu'@'localhost' (using password: NO) in /home/soizastu/public_html/cms/happy-api/retrieve.php on line 6 Error connecting to database.
基本上在cms文件夹中是config.php,我想包括“../config.php”;会做的伎俩,但它看起来如此.
尝试计算绝对路径并包括它.
include(dirname(__FILE__)."/../config.php");
我认为这是处理多层次包含时最安全的选择.