How to enable developer mode in magento 1.7?

I go through this tutorial and my problem is that I am not getting any function. Include the error in "Global configuration and Model creation" (when assigning the variable Mage::getModel('weblog/blogpost') while the model does not exist yet).

At some point, I found an if statement in /index.php that calls the following method: Mage::setIsDeveloperMode(true); To test this, I put it outside the if statement (which I know is not good practice).

As a result, I received this warning:

 Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : XML declaration allowed only at the start of the document in /home/dowebro/public_html/magento/lib/Varien/Simplexml/Config.php on line 510 #0 [internal function]: mageCoreErrorHandler(2, 'simplexml_load_...', '/home/dowebro/p...', 510, Array) #1 /home/dowebro/public_html/magento/lib/Varien/Simplexml/Config.php(510): simplexml_load_string(' loadString(' loadFile('/home/dowebro/p...') #4 /home/dowebro/public_html/magento/app/code/core/Mage/Core/Model/Config.php(318): Mage_Core_Model_Config->loadModulesConfiguration(Array, Object(Mage_Core_Model_Config)) #5 /home/dowebro/public_html/magento/app/code/core/Mage/Core/Model/App.php(414): Mage_Core_Model_Config->loadModules() #6 /home/dowebro/public_html/magento/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules() #7 /home/dowebro/public_html/magento/app/Mage.php(683): Mage_Core_Model_App->run(Array) #8 /home/dowebro/public_html/magento/index.php(91): Mage::run('', 'store') #9 {main} 

but still there is no error that I would expect.

So, how can I get rid of this warning, but more importantly, how can I see errors in design mode?

Thanks!

EDIT: Although I continue this tutorial, I see that I am not getting any feedback from the main classes. Example: I should get "Cannot get entity configuration: weblog / blogpost", trying to get data from a model whose definition is incomplete. Well, no .: |

+4
source share
3 answers

Developer mode is a kind of use strict for PHP and Magento. It makes you fix everything . If it looks like a simplexml_load_string function, you don’t like one of the XML configuration files on your system. You can find out which one went to line 510 in

 /home/dowebro/public_html/magento/lib/Varien/Simplexml/Config.php 

and var, resetting the variable that is passed to loadFile .

Based on error message

 XML declaration allowed only at the start of the document 

My guess is your prolog config.xml XML has spaces in front of it

 [ ]<?xml version=... 

or did you accidentally add <? into your xml file.

+8
source

I do not know why my post was deleted. Modifications I can’t even return a message.

I followed the same tutorial as @Michael and ran into the same problem.

The solution will be implemented in the root application index.php and remove the hash from the beginning of the instruction below

 #ini_set('display_errors', 1) 

to

 ini_set('display_errors', 1) 
0
source

I have this problem and I can solve the debugging of the file app \ code \ core \ Mage \ Core \ Model \ Config.php

In this class, find the metod loadModulesConfiguration and make sure you have the following code:

 foreach ($fileName as $configFile) { $configFile = $this->getModuleDir('etc', $modName).DS.$configFile; if ($mergeModel->loadFile($configFile)) { $mergeToObject->extend($mergeModel, true); } } 

And this will add an attempt to block as follows:

 foreach ($fileName as $configFile) { try { $configFile = $this->getModuleDir('etc', $modName).DS.$configFile; if ($mergeModel->loadFile($configFile)) { $mergeToObject->extend($mergeModel, true); } } catch(Exception $e) { Mage::log($configFile); } } 

And then check the log and you will have the file name being the problem

0
source

Source: https://habr.com/ru/post/1438085/


All Articles