Magento管理类别出现灰色屏幕-新安装


Magento Manage Categories comes up with grey screen - new install

我使用MAMP Pro来驱动服务器,这样我就可以在本地开发Magento站点。我是Magento开发的新手,由于我编码的几个错误,我最终重新开始了。我删除了以前的数据库,在MAMP Pro中创建了一个新的url(即devmagento.com:8888),指向我创建的一个新文件夹,将Magento社区版放在文件夹中,完成了安装过程,一切都安装得很完美。安装后,我尝试转到"管理类别"页面,注意到它加载了部分标题,直到它变为"以贝斯手身份登录7"。在那之后什么都没有——只有灰色。所有其他管理页面都可以工作(我没有尝试过每一个,但我尝试过的那些都尝试过)。

除了重新索引和关闭缓存之外,在转到类别页面之前,我没有做任何更改。无上传,无配置更改等。

在故障排除过程中,我打开了日志记录(在"管理">"配置"中)和Profiler。日志记录似乎只记录前端。

我有点不知所措,不知道该找什么。我还进入了var/cache,并清除了它。

感谢您的帮助!!

在新的Magento开发主机上要做的第一件事就是打开开发人员模式
原因是,默认情况下,Magento将尝试隐藏所有错误消息,除非启用了开发人员模式。

如何启用开发人员模式

有几种方法可以做到这一点。前两个选项只能被视为快速破解,因为它们不安全升级。第三种选择是正确的方法

选项1
在Magento根目录中,您将看到一个名为.htaccess
的文件将以下代码放在该文件的顶部或底部。

SetEnv MAGE_IS_DEVELOPER_MODE 1

重新加载后端页面,希望您会看到一条错误消息
警告:.htaccess文件是Magento核心的一部分,在升级过程中会被覆盖。此外,不要将其部署到具有该设置的活动服务器上。

选项2
打开Magento根目录中的文件index.php
在第66行周围,您将看到以下代码:

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
}

更改该选项,以便无论MAGE_IS_DEVELOPER_MODE设置如何都启用开发人员模式。

if (true || isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
}

警告:index.php文件也是Magento核心的一部分,它将在升级过程中被覆盖,就像.htaccess文件一样。此外,不要将其部署到具有该设置的活动服务器上。

选项3
启用开发人员模式的正确方法是将设置放在apache配置中,例如vhost声明。我不知道MAMP Pro把它们放在哪里,但对于OS X上的普通apache,我使用/etc/apache2/external/httpd-vhosts.conf来配置我的开发主机。这是一个示例条目:

<VirtualHost *:80>
    DocumentRoot "/path/to/my/workspace/magento.dev/htdocs"
    ServerName magento.dev
    SetEnv MAGE_IS_DEVELOPER_MODE 1
    ErrorLog "/private/var/log/apache2/magento-error_log"
    CustomLog "/private/var/log/apache2/magento-access_log" common
</VirtualHost>

这样做的好处是,您可以将所有未更改的文件从开发服务器部署到临时服务器,以及从临时服务器部署到活动服务器。

进一步调试
一旦启用了开发人员模式,您将有望看到一条错误消息,而不仅仅是灰色屏幕
如果这没有帮助(仍然没有消息),请检查Magento日志文件。它们位于子文件夹中的Magento根目录中

  • var/log/exception.log
  • var/log/system.log

检查它们是否有任何错误消息,如"无效块类"或"无效模板…"。
还是没有运气
查看Apache或PHP错误日志。它们位于Magento安装之外,位置取决于系统配置。也许PHP错误日志仍然需要启用。查看MAMP Pro如何使用该捆绑包
有问题的PHP设置是log_errors

说到PHP设置。。。您还需要确保display_errors设置为On。否则,无论开发人员的模式如何,大多数核心错误(例如中止编译的语法错误)都将不可见。

将其放入/magento/文件夹中名为.htaccess的文件中

############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi
#    Action php5-cgi /cgi-bin/php5-cgi
#    AddHandler php5-cgi .php
############################################
## GoDaddy specific options
#   Options -MultiViews
## you might also need to add this line to php.ini
##     cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini
############################################
## this line is specific for 1and1 hosting
    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php
############################################
## default index file
    DirectoryIndex index.php
<IfModule mod_php5.c>
############################################
## adjust memory limit
#    php_value memory_limit 64M
    php_value memory_limit 256M
    php_value max_execution_time 18000
############################################
## disable magic quotes for php request vars
    php_flag magic_quotes_gpc off
############################################
## disable automatic session start
## before autoload was initialized
    php_flag session.auto_start off
############################################
## enable resulting html compression
    #php_flag zlib.output_compression on
###########################################
# disable user agent verification to not break multiple image upload
    php_flag suhosin.session.cryptua off
###########################################
# turn off compatibility with PHP4 when dealing with objects
    php_flag zend.ze1_compatibility_mode Off
</IfModule>
<IfModule mod_security.c>
###########################################
# disable POST processing to not break multiple image upload
    SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>
<IfModule mod_deflate.c>
############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip
    # Insert filter on all content
    ###SetOutputFilter DEFLATE
    # Insert filter on selected content types only
    #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css    text/javascript
    # Netscape 4.x has some problems...
    #BrowserMatch ^Mozilla/4 gzip-only-text/html
    # Netscape 4.06-4.08 have some more problems
    #BrowserMatch ^Mozilla/4'.0[678] no-gzip
    # MSIE masquerades as Netscape, but it is fine
    #BrowserMatch 'bMSIE !no-gzip !gzip-only-text/html
    # Don't compress images
    #SetEnvIfNoCase Request_URI '.(?:gif|jpe?g|png)$ no-gzip dont-vary
    # Make sure proxies don't deliver the wrong content
    #Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_ssl.c>
############################################
## make HTTPS env vars available for CGI mode
    SSLOptions StdEnvVars
</IfModule>
<IfModule mod_rewrite.c>
############################################
## enable rewrites
    Options +FollowSymLinks
    RewriteEngine on
############################################
## you can put here your magento root folder
## path relative to web root
    RewriteBase /magento/
############################################
## workaround for HTTP authorization
## in CGI environment
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
############################################
## always send 404 on missing files in these folders
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
############################################
## never rewrite for existing files, directories and links
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
############################################
## rewrite everything else to index.php
    RewriteRule .* index.php [L]
</IfModule>

############################################
## Prevent character encoding issues from server overrides
## If you still have problems, use the second line instead
    AddDefaultCharset Off
    #AddDefaultCharset UTF-8
<IfModule mod_expires.c>
############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires
    ExpiresDefault "access plus 1 year"
</IfModule>
############################################
## By default allow all access
    Order allow,deny
    Allow from all
###########################################
## Deny access to release notes to prevent disclosure of the installed Magento version
    <Files RELEASE_NOTES.txt>
        order allow,deny
        deny from all
    </Files>
############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags
    #FileETag none