Magento排错:Exception printing is disabled by def...
2012-10-21 10:06
375 查看
![](http://alex.7enet.com/wp-content/uploads/2012/03/magento.jpg)
今天有个朋友说安装了Magento之后,无法登陆,检查了一遍设置,都没问题,最后想了一遍,决定从程序入手来排查。
先说一下错误提示:
Exception printing is disabled by default for security reasons. Error log record number: XXXXXXXXXXXXXXX |
找到:
/errors/local .xml.sample |
然后在网站根目录下建立一个文件目录 tmp ,接着找到
. /lib/Zend/Cache/Backend/File .php |
protected $_options = array ( 'cache_dir' => 'null' , |
protected $_options = array ( 'cache_dir' => 'tmp/' , |
Illegal scheme supplied,only alphanumeric characters are permitted Trace: #0 /home/artsandc/public_html/app/code/core/Mage/Core/Model/Store.php(712): Zend_Uri::factory(’{{base_url}}’) #1 /home/artsandc/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(313): Mage_Core_Model_Store->isCurrentlySecure() #2 /home/artsandc/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(161): Mage_Core_Controller_Varien_Front->_checkBaseUrl(Object(Mage_Core_Controller_Request_Http)) #3 /home/artsandc/public_html/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch() #4 /home/artsandc/public_html/app/Mage.php(640): Mage_Core_Model_App->run(Array) #5 /home/artsandc/public_html/index.php(80): Mage::run(’’,‘store’) #6 {main} |
http://www.magentocommerce.com/boards/viewthread/263751/
主要产生的原因:
问题主要出在:{{base_url}} 这个参数上,如果填入的域名是类似localhost之类域名,中间没有用点号分隔开的话,产生错误的机会极大。而产生错误的文件为 /app/code/core/Mage/Core/Model/Store.php
在 1.6.0.0的版本中, $secureBaseUrl是一个空值,但是在 1.6.1.0 的版本中则为数据库中的一个值。如果数据库中你有设置‘{{base_url}}’,那么$secureBaseUrl 就会被赋予 ‘{{base_url}}’. 而这个值恰恰会导致函数:
Zend_Uri::factory( $secureBaseUrl ); |
以下是两种解决方法:
1、Dan Jones 提供的解决方法:dan jones写了一个扩展补丁包,可以下载到网站根目录下,解压即可,下载地址:
http://www.danneh.org/files/24
本地:BTS_1610Fix.tar
2、Jefferson Luís 提供的解决方法
打开:
./app/code/core/Mage/Core/Model/Store.php
找到712行:
$uri =Zend_Uri::factory( $secureBaseUrl ); $port = $uri ->getPort(); |
// this solution is offer by 7ENET.COM TechTeam if (false !== strpos ( $secureBaseUrl , '{{base_url}}' )) { $secureBaseUrl =Mage::getConfig()->substDistroServerVars( '{{base_url}}' ); } //end of custom code. |
相关文章推荐
- magento提示Exception printing is disabled by default for security reasons.
- magento提示Exception printing is disabled by default for security reasons.
- magento提示Exception printing is disabled by default for security reasons.
- 排错Package restore is disabled by default. To give consent, open the Visual Studio Options dialog
- java.lang.IllegalArgumentException: Fielddata is disabled on text fields by default. Set fielddata=t
- java.lang.IllegalArgumentException: findUserById is ambiguous in Mapped Statements collection
- 解决pycharm运行多线程程序报错"Unhandled exception in thread started by sys.excepthook is missing"
- The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) - Powered By Kayako SupportSuite
- Nuget 报错:Package restore is disabled by default.解决办法
- (转)es进行聚合操作时提示Fielddata is disabled on text fields by default
- es进行聚合操作时提示Fielddata is disabled on text fields by default
- spring aop Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: 报错
- 【转】IIS: The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
- Caused by: org.hibernate.hql.ast.QuerySyntaxException: TkltEmpQuitProcess is not mapped. 问题解决
- ElasticSearch fielddata is disabled on text fields by default. set fielddata=true on interests
- Caused by: redis.clients.jedis.exceptions.JedisDataException: DENIED Redis is running in protected m
- 发送邮件时,报postdrop: warning: inet_protocols: IPv6 support is disabled: Address family not supported by
- java.lang.SecurityException: Filter of class org.apache.catalina.ssi.SSIFilter is privileged and cannot be loaded by this web application
- weblogic.management.ManagementException: The domain edit lock is owned by another session in ...
- Exception UserExistException is not compatible with throws clause in UserService.findUserByName(Stri