如何在XAMPP中使用站点文件配置CodeIgniter?

发布于 2025-01-30 03:43:37 字数 380 浏览 3 评论 0原文

我最近接管了另一个开发人员的一个项目,我们称其为eBay。我正在努力将他们的现场站点启动并在本地服务器上运行,以进行测试和调试。他们已经使用CodeIgniter构建了Web应用程序。在CPANEL上的文件管理器中,他们将CI文件夹放在根部,而不是public_html文件夹中。

我已经将他们的public_html文件和CI文件夹复制到了我的XAMPP的HTDOCS文件夹中。问题在于,仅当将CI文件夹放置在eBay的文件夹中时,该站点才会加载。求心时,当我加载Localhost网站时,会提供一条错误消息,即它在eBay文件夹中找不到CodeIgniter文件夹。

这怎么样?该应用程序如何在实时站点上的根网站上使用CI文件夹运行,但是当我将其迁移到XAMPP的HTDOC时,它希望CI文件夹在eBay文件夹中?

I've recently taken over a project from another developer, let's call it EBAY. I'm struggling to get their live site up and running on my local server for testing and debugging. They've built a web app using CodeIgniter. In their file manager on cPanel they've placed the ci folder at the root, not in the public_html folder.

I've copied their public_html files and their ci folder into my xampp's htdocs folder. The issue is that the site only loads when the ci folder is placed WITHIN the folder for EBAY. Oherwise when I load the localhost site it gives an error message that it cannot find the codeigniter folder inside EBAY folder.

How is this? How can the application run with the ci folder at the root on the live site, but when I have migrated it to the htdocs of xampp it is expecting the ci folder to be inside the EBAY folder?

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

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

发布评论

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

评论(1

烟燃烟灭 2025-02-06 03:43:37

如今,这种配置非常普遍,如果您查看Linux或Pear,您会发现PHP文件有时完全在WebServer以外的其他目录中。
它背后的想法非常简单但有效:

  1. 无法从网络 /互联网上找到任何文件。
    因此,它们无法更改,下载甚至只是查看。
  2. PHP(或其他)库明显与单个代码分开,无法轻易混合或意外删除。
  3. 访问权限更容易控制,甚至可能与WebFolder中的文件不同。

好的,到目前为止是一个解释。现在关于您的问题:
当前,您当前是XAMPP中的Web Folder HTDOC,通常您可以将子文件夹用作Web Folder,在HTDOC中,您可以直接将不公开的项目文件放置。您可以调整域指向的位置(DOCROOT和/或虚拟主机)。

This kind of configuration is quite common nowadays, and if you look at Linux or Pear you'll discover that PHP files sometimes are completely in other directories than the webserver.
The ideas behind this are pretty simple but effective:

  1. Any files can't be reached from the network / internet.
    So they can't be altered, downloaded or even just viewed.
  2. PHP (or other) Libraries are clearly separated from individual code and can't be easily mixed up or accidentally be deleted.
  3. Access rights are easier to control and perhaps even that differently than the files in the webfolder.

Ok, so far an explanation. Now about your issue with it:
You've currently a webfolder htdocs in Xampp and in general you can use a subfolder as the webfolder and in htdocs directly you place the project files that are not public. You've to adjust then where the domain is pointing (docroot and/or virtual hosts).

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