【发布时间】:2012-04-03 07:38:55
【问题描述】:
我成功创建了几个 magento 主题,它们都在网络服务器上运行良好。因为其他开发人员在网络服务器上进行了一些更改(也运行良好),所以我尝试将所有文件从我的主题导入回我的本地系统以应用更少的更改。 在那之后,我在本地主机上的主题突然完全崩溃了。网站的来源是好的,但是应该从 skin/../images 文件夹中加载的所有图像都没有显示。如果我尝试使用浏览器打开它们,我会收到 500 内部服务器错误,但它们存储在文件系统中的正确位置。
所以我检查了一些我早期的主题,但如果我将它们从文件系统或其他文件夹备份到我的 magento 安装中,它们都很好。
所以我终于设置了一个新的本地 magento 安装,但也得到了同样的错误。正如我所说,我的所有其他主题都运行良好,并且具有实际主题的网络服务器到目前为止没有问题。
最好的问候
编辑以回答@Oğuz 的想法
感谢您的回答。 我收到错误后检查了日志,并得到以下信息:
[Sun Mar 18 20:53:24 2012] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/theme/media/catalog/category/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://localhost/theme/index.php/apparel/shirts.html
[Sun Mar 18 20:53:25 2012] [error] [client 127.0.0.1] script '/var/www/index.php' not found or unable to stat, referer: http://localhost/theme/index.php/apparel/shirts.html
[Sun Mar 18 20:53:25 2012] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/theme/media/catalog/category/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://localhost/theme/index.php/apparel/shirts.html
[Sun Mar 18 20:53:39 2012] [error] [client 127.0.0.1] script '/var/www/index.php' not found or unable to stat, referer: http://localhost/theme/index.php/apparel/shirts/zolof-the-rock-and-roll-destroyer-lol-cat-t-shirt.html
[Sun Mar 18 20:53:39 2012] [error] [client 127.0.0.1] script '/var/www/index.php' not found or unable to stat, referer: http://localhost/theme/index.php/apparel/shirts/zolof-the-rock-and-roll-destroyer-lol-cat-t-shirt.html
[Sun Mar 18 20:54:37 2012] [error] [client 127.0.0.1] client denied by server configuration: /var/www/theme/app/etc/local.xml
[Sun Mar 18 20:54:51 2012] [error] [client 127.0.0.1] script '/var/www/index.php' not found or unable to stat, referer: http://localhost/theme/index.php/apparel/shirts/zolof-the-rock-and-roll-destroyer-lol-cat-t-shirt.html
[Sun Mar 18 20:54:51 2012] [error] [client 127.0.0.1] script '/var/www/index.php' not found or unable to stat, referer: http://localhost/theme/index.php/apparel/shirts/zolof-the-rock-and-roll-destroyer-lol-cat-t-shirt.html
[Sun Mar 18 20:56:33 2012] [error] [client 127.0.0.1] client denied by server configuration: /var/www/theme/app/etc/local.xml
[Sun Mar 18 20:56:41 2012] [error] [client 127.0.0.1] client denied by server configuration: /var/www/theme/app/etc/local.xml
[Sun Mar 18 20:56:49 2012] [alert] [client 127.0.0.1] /var/www/theme/skin/frontend/theme/green/images/.htaccess: Invalid command 'ExpiresDefault', perhaps misspelled or defined by a module not included in the server configuration
我不确定,为什么我会突然得到这些。我尝试先关注 local.xml 问题。
编辑#2
感谢您的所有想法和答案。在检查了我的本地服务器后,我发现,我服务器上托管的几乎每个页面都有这个问题。似乎是 apache 配置文件中某处的错误配置。 我会在下一步尝试修复它。
我还检查了 AllowOverride 指令,但它已经设置为“全部”。
【问题讨论】:
-
你检查过错误日志,了解 500 错误背后的原因吗?
-
500 Internal Server 是一个一般错误消息,如果没有看到您的代码/环境,没人知道发生了什么。转到网络服务器日志文件并检查那里发生了什么!