Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
文件系统根目录的PHP本地路径_Php_Include - Fatal编程技术网

文件系统根目录的PHP本地路径

文件系统根目录的PHP本地路径,php,include,Php,Include,我不知道我做了什么。我有一个php文件“create_account.php”,它 在与“createuaccount.php”相同的文件夹中,有一个文件夹“include”,内部有一个文件accounts.php。当我试图打开“create_account.php”时,我得到一个没有这样的文件或目录错误 经过大约一个小时的努力,我将“includes”文件夹放到了文件系统的根目录下,它开始工作了。为什么“includes/accounts.php”会打开“/includes/account

我不知道我做了什么。我有一个php文件“create_account.php”,它


在与“createuaccount.php”相同的文件夹中,有一个文件夹“include”,内部有一个文件accounts.php。当我试图打开“create_account.php”时,我得到一个没有这样的文件或目录错误

经过大约一个小时的努力,我将“includes”文件夹放到了文件系统的根目录下,它开始工作了。为什么“includes/accounts.php”会打开“/includes/accounts.php”

编辑:没有足够的代表回答我自己的问题,所以我将把它放在这里

好吧,这太愚蠢了。。。结果我的IDE“Coda 2”在我单击preview时决定它应该是执行PHP代码的IDE,而不是Apache

/facedesk怎么样

<?php include("./includes/accounts.php"); ?>

因此,您可以明确地声明要在同一目录中打开该文件


另一个想法:文件系统属性正常吗?php cgi/webserver是否允许读取文件
accounts.php

什么是您的cwd和include\u path ini指令?什么是“cwd”,我得到的错误是include\u路径是“:”将include\u路径更改为
)使用set\u include\u path将include路径设置为“.”,仍然访问根文件系统:3Fixed(参见原始帖子)“./includes/accounts.php”也会失败。对于文件系统属性,我不知道如何检查它们是否正常。我想到了chmod设置的文件权限:您是否尝试过
accounts.php
755
?刚刚将其更改为755(我不知道以前是什么),仍然相同的结果已确定(见原文)
<?php include("./includes/accounts.php"); ?>