gpt4 book ai didi

linux - 将 Codigniter 从 Windows 服务器迁移到基于 Linux 的服务器

转载 作者:太空宇宙 更新时间:2023-11-04 03:38:27 25 4
gpt4 key购买 nike

我已将基于 CodeIgniter 的站点从基于 Windows 的服务器迁移到基于 Linux 的服务器。我遇到过各种各样的问题。目前我陷入图像无法上传的困境。 (服务器超时错误)

采取的步骤:将上传文件夹设置为 777。尝试 php 5.4 和 5.2。我在某处寻找可疑的临时文件夹,但没有找到。我搜索过,发现一篇讨论 CodeIgniter 在 300 秒后超时的文章。但就我而言,上传几乎立即超时。尝试上传的文件大小为 41kb。我检查了php设置,max_input_time:60,upload_max_filesize:64M,post_max_size:64M不确定我还可以添加什么。

经过更多搜索和一些测试,很可能是 Ajax 和 CI 之间的冲突。正常的 php 上传工作正常。我发现了一些讨论 CI 和 Ajax 问题的文章。不幸的是,它们似乎与我的代码不匹配。

还有更多:我找到了一些日志文件。它们确实与我在网站上所做的相对应。第一行是最后一行,显示刷新网页的 Action 和所用的时间。以下几行用于单击浏览图像并单击上传。有趣的是几次被忽略的加载文件尝试。

DEBUG - 2015-06-10 01:58:43 --> Total execution time: 0.0495
DEBUG - 2015-06-10 02:00:10 --> Config Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Hooks Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Utf8 Class Initialized
DEBUG - 2015-06-10 02:00:10 --> UTF-8 Support Enabled
DEBUG - 2015-06-10 02:00:10 --> URI Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Router Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Output Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Input Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Global POST and COOKIE data sanitized
DEBUG - 2015-06-10 02:00:10 --> Language Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Loader Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Helper loaded: url_helper
DEBUG - 2015-06-10 02:00:10 --> Helper loaded: sql_date_helper
DEBUG - 2015-06-10 02:00:10 --> Helper loaded: form_helper
DEBUG - 2015-06-10 02:00:10 --> Database Driver Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Native_session Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Session class already loaded. Second attempt ignored.
DEBUG - 2015-06-10 02:00:10 --> Cart Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Encrypt Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Model Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Model Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Model Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Controller Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Template Class Initialized
DEBUG - 2015-06-10 02:00:10 --> MY Controller Class Initialized
DEBUG - 2015-06-10 02:00:10 --> Encrypt class already loaded. Second attempt ignored.

更多信息:2015 年 6 月 11 日:

经过大量搜索,我认为这不是 CodeIgniter 问题。这似乎是 Dojo 的问题。我在product.php 文件中找到了这个

if (!$this->ajaxupload->do_upload('flashUploadFiles'))

此文件中的某个位置应该有 Dojo 的设置,但我找不到它们。不知道我真正在寻找什么。 Dojo 网站上的帮助看起来确实很困惑。我还认为,不仅仅是上传 Dojo 文件并将一些代码放在正确的位置来激活它。我想知道服务器上是否有需要激活的东西。

我还将 Dojo 添加到标签列表

最佳答案

该错误可能与权限有关,只需按照步骤操作,这些可能会对您有所帮助

  1. 检查 config.php 文件中的 base_url 和其他上传路径(如果给定)。
  2. 检查 codeigniter 中使用的所有图像和资源是否位于项目文件夹中,而不是计算机中的其他位置。
  3. 您的项目根目录中应该有一个名为 asset 的文件夹,并且所有文件夹和文件的权限应为 777。
  4. “应用程序”和“系统”文件夹的权限应为 755,其中的所有文件夹的权限应为 755,对于其中的所有文件,权限应为 644。
  5. 如果问题没有解决,请检查图像路径,如果静态使用路径,则它可能指向您计算机的任何位置。你应该管理这个。
  6. 如果您的网址已更改,请也在 .htacces 文件中进行更改。

关于linux - 将 Codigniter 从 Windows 服务器迁移到基于 Linux 的服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30722826/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com