Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn on developer mode in magento 1.7?

I go through this tutorial and my problem consists in the fact that I do not get any function.include error on "The Global Config and Creating The Model" section (when assigning to a variable Mage::getModel('weblog/blogpost'), while the model doesn't exists yet).

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

The result was that I got this warning message:

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 no error which I would expect.

So, how can I get rid of this Warning message, but more important, how can I see errors in developement mode?

Thank you!

EDIT: While I go on with this tutorial, I see that I don't get any kind of feedback from core classes. Ex: I should get "Can't retrieve entity config: weblog/blogpost" while trying yo get data from a model of which resource definition is incomplete. Well, I don't. :|

like image 690
Michael Avatar asked Feb 18 '23 22:02

Michael


1 Answers

Developer mode is a sort of use strict for PHP and Magento. It forces you to fix everything. If looks like the simplexml_load_string function doesn't like one of the XML configuration files in your system. You can find out which one by going to line 510 in

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

and var dumping the variable that's being passed to loadFile.

Based on the error message

XML declaration allowed only at the start of the document

My guess is your config.xml XML prolog has some whitespace before it

[    ]<?xml version=...

or you've accidentally added a <? somewhere in your XML file.

like image 50
Alan Storm Avatar answered Mar 06 '23 05:03

Alan Storm