迁移Magento后出现问题
我正在尝试在本地服务器上创建 Magento 生产服务器的精确镜像以进行进一步开发,但我遇到了一些问题。
在生产服务器上,我们的 Magento 配置为在不显示 index.php
的情况下运行,但在尝试迁移到本地服务器后,需要 index.php
才能访问任何链接。此外,当我选择要访问的类别(例如)时,我会被定向到 http://localhost/category.html
而不是 http://localhost/my-magento-store .com/index.php/category.html
我注意到的另一个问题是我无法登录管理部分。输入正确的登录凭据后,我再次重定向到登录屏幕,没有任何错误消息。
我正在本地服务器上运行 MAMP 堆栈,这就是我所做的:
- 创建了整个生产服务器的 tar
- 在 Magento
System > 中创建了数据库备份工具>备份
- 下载并解压 tar 到本地目录
- 使用 Alexey Ozerov 的 大转储 脚本。 (.sql 文件有 130 万行)
- 更改了
core_config_data
表中web/unsecure/base_url
和web/secure/base_url
的值。 (因为我没有自签名的 SSL 证书,所以我将http://localhost:8888/my-magento-store/
作为两个值) - 转储
var/cache 的内容
和var/sesson
- 将本地开发服务器上所有文件的权限更改为 755
- 导航到
http://localhost:8888/my-magento-store/
但是而是得到了“/的索引”页面。 - 导航到 http://localhost:8888/my-magento-store/index.php 并收到错误。
- 遵循 这些步骤解决了错误,重新加载页面,主页正确加载。
有什么想法吗?
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:
- Created a tar of the entire production server
- Created a database backup in Magento
System > Tools > Backups
- Downloaded and extracted tar into local directory
- Imported database dump into local MySQL using Alexey Ozerov's big dump script. (The .sql file is 1.3m lines)
- Changed values of
web/unsecure/base_url
andweb/secure/base_url
incore_config_data
table. (As I don't have a self-signed SSL cert, I puthttp://localhost:8888/my-magento-store/
for both values) - Dumped contents of
var/cache
andvar/sesson
- Changed permissions to 755 for all files on local dev server
- Navigated to
http://localhost:8888/my-magento-store/
but got the "Index of /" page instead. - Navigated to
http://localhost:8888/my-magento-store/index.php
and got an error. - Followed these steps to solve the error, reloaded the page, and the home page loaded correctly.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
URL 重写取决于您的 .htaccess 文件,因此需要检查以下几项内容:
core_config_data
中的web/seo/use_rewrites
应为true
。.
文件,特别是.htaccess
?如果您使用了tar -cvf archive.tar *
那么它可能会错过它们。 (*nix 的不错的“功能”)。httpd.conf
是否具有AllowOverride All
,否则您的本地.htaccess
将被忽略。哈特哈,
京东
URL Rewriting depends on your .htaccess file, so there are a couple of things to check:
web/seo/use_rewrites
incore_config_data
should betrue
..
files in the root directory especially.htaccess
? If you usedtar -cvf archive.tar *
then it may have missed them. (Nice "feature" of *nix).httpd.conf
hasAllowOverride All
, otherwise your local.htaccess
will be ignored.HTH,
JD