迁移Magento后出现问题

发布于 2024-09-26 21:33:32 字数 1340 浏览 0 评论 0原文

我正在尝试在本地服务器上创建 Magento 生产服务器的精确镜像以进行进一步开发,但我遇到了一些问题。

在生产服务器上,我们的 Magento 配置为在不显示 index.php 的情况下运行,但在尝试迁移到本地服务器后,需要 index.php 才能访问任何链接。此外,当我选择要访问的类别(例如)时,我会被定向到 http://localhost/category.html 而不是 http://localhost/my-magento-store .com/index.php/category.html

我注意到的另一个问题是我无法登录管理部分。输入正确的登录凭据后,我再次重定向到登录屏幕,没有任何错误消息。

我正在本地服务器上运行 MAMP 堆栈,这就是我所做的:

  1. 创建了整个生产服务器的 tar
  2. 在 Magento System > 中创建了数据库备份工具>备份
  3. 下载并解压 tar 到本地目录
  4. 使用 Alexey Ozerov 的 大转储 脚本。 (.sql 文件有 130 万行)
  5. 更改了 core_config_data 表中 web/unsecure/base_urlweb/secure/base_url 的值。 (因为我没有自签名的 SSL 证书,所以我将 http://localhost:8888/my-magento-store/ 作为两个值)
  6. 转储 var/cache 的内容var/sesson
  7. 将本地开发服务器上所有文件的权限更改为 755
  8. 导航到 http://localhost:8888/my-magento-store/ 但是而是得到了“/的索引”页面。
  9. 导航到 http://localhost:8888/my-magento-store/index.php 并收到错误。
  10. 遵循 这些步骤解决了错误,重新加载页面,主页正确加载。

有什么想法吗?

I am trying to create an exact mirror of a Magento production server on my local server for further development, but I have run into a few issues.

On the production server, our Magento is configured to run without displaying the index.php, but after attempting a migration to my local server, the index.php is required to access any links. Additionally, when I select a category to visit (for example), I am directed to http://localhost/category.html instead of http://localhost/my-magento-store.com/index.php/category.html

The other issue I've noticed is that I am unable to log in to the admin section. After entering the correct login credentials, I am redirected to the login screen again without any error messages.

I am running a MAMP stack on the local server, and here is what I have done:

  1. Created a tar of the entire production server
  2. Created a database backup in Magento System > Tools > Backups
  3. Downloaded and extracted tar into local directory
  4. Imported database dump into local MySQL using Alexey Ozerov's big dump script. (The .sql file is 1.3m lines)
  5. Changed values of web/unsecure/base_url and web/secure/base_url in core_config_data table. (As I don't have a self-signed SSL cert, I put http://localhost:8888/my-magento-store/ for both values)
  6. Dumped contents of var/cache and var/sesson
  7. Changed permissions to 755 for all files on local dev server
  8. Navigated to http://localhost:8888/my-magento-store/ but got the "Index of /" page instead.
  9. Navigated to http://localhost:8888/my-magento-store/index.php and got an error.
  10. Followed these steps to solve the error, reloaded the page, and the home page loaded correctly.

Any ideas?

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

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

发布评论

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

评论(1

睡美人的小仙女 2024-10-03 21:33:32

URL 重写取决于您的 .htaccess 文件,因此需要检查以下几项内容:

  1. core_config_data 中的 web/seo/use_rewrites 应为 true
  2. 当您创建 tarball 时,它是否在根目录中包含 . 文件,特别是 .htaccess ?如果您使用了 tar -cvf archive.tar * 那么它可能会错过它们。 (*nix 的不错的“功能”)。
  3. 检查您的 MAMP httpd.conf 是否具有 AllowOverride All,否则您的本地 .htaccess 将被忽略。
  4. 我不熟悉 MAMP,但它可能在读取/解释您的 .htaccess 时出现问题,尽管这不太可能。我首先关注选项 1 到 3。

哈特哈,
京东

URL Rewriting depends on your .htaccess file, so there are a couple of things to check:

  1. web/seo/use_rewrites in core_config_data should be true.
  2. when you created your tarball, did it include . files in the root directory especially .htaccess? If you used tar -cvf archive.tar * then it may have missed them. (Nice "feature" of *nix).
  3. Check that your MAMP httpd.conf has AllowOverride All, otherwise your local .htaccess will be ignored.
  4. I'm not familiar with MAMP, but it's possible that it's having a problem reading/interpreting your .htaccess, though this is unlikely. I'd focus on options 1 thru 3 first.

HTH,
JD

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