如何在Webside上访问/读取文件/页面

发布于 2025-01-31 18:11:21 字数 1029 浏览 2 评论 0原文

就我而言,我得到了此错误按摩

致命错误:未被发现的错误:在/webspace/projectfolder/pages/projectfolder/pages/add_eventuser.php:10 stack trace:#0 {main {main}扔入/webspace/projectfolder/pages/add_eventuser.php in/webspace/projectuser.php 10

$ _ server ['document_root']

要在我的结构中获取文件的确切路径,

我像这样组织了文件:

projectFolder/inclate/class.php projectFolder/pages/initiatorpage.php我遇到了致命错误

  public class DatabaseColums
  {
    public function loadDatabase($databaseName)
    {
      $databaseName = "test";

      return $databaseName;
    }

  }

include $_SERVER['DOCUMENT_ROOT'].'includes/RandomClass.php';

  $dbinput = new DatabaseColums();

    echo $dbinput->loadDatabase();

我制作了文件夹/文件限制读/写/可执行文件

无法向自己解释为什么我仍然按摩。

这是什么问题。

感谢您的关注

in my case I get this error massage

Fatal error: Uncaught Error: Class "RandomClass" not found in /webspace/projectfolder/pages/add_eventuser.php:10 Stack trace: #0 {main} thrown in /webspace/projectfolder/pages/add_eventuser.php on line 10

I use

$_SERVER['DOCUMENT_ROOT']

to get the exact path of the file

In my structure i organized the files like this:

projectfolder/includes/class.php where the pointed class should loaded
projectfolder/pages/initiatorpage.php where i got the Fatal Error

  public class DatabaseColums
  {
    public function loadDatabase($databaseName)
    {
      $databaseName = "test";

      return $databaseName;
    }

  }

include $_SERVER['DOCUMENT_ROOT'].'includes/RandomClass.php';

  $dbinput = new DatabaseColums();

    echo $dbinput->loadDatabase();

I made the folder/file restrictions read/write/executeable

Cant explain to myself why I got still this massage.

What Issue is behind that.

Thank you for your attention

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最后的乘客 2025-02-07 18:11:21

问题是$ _ SERVER ['document_root']/file.php

- right:$ 之间的缺少/ _server ['document_root']。 / folder/files.php

-wrong: $ _ server ['document_root']。文件夹/file.php

谢谢@ajmal praveen和
@adyson

the problem was a missing / between $_SERVER['DOCUMENT_ROOT'] and /folder/file.php

--right :$_SERVER['DOCUMENT_ROOT']./ folder/file.php

--wrong: $_SERVER['DOCUMENT_ROOT'].folder/file.php

Thank you @Ajmal Praveen and
@ADyson

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文