I installed a copy of Magento 1.6.1.0 on a dev site I setup to do some testing with Varnish with (more on that later). However, in the requirement to be able to get to Magento using 2 different URL’s, I stumbled across this quite annoying bug.
a:5:{i:0;s:67:"Illegal scheme supplied, only alphanumeric characters are permitted";i:1;s:729:"#0 /home/dan/workspace/magento1610/app/code/core/Mage/Core/Model/Store.php(712): Zend_Uri::factory('{{base_url}}')
#1 /home/dan/workspace/magento1610/app/code/core/Mage/Core/Controller/Varien/Front.php(313): Mage_Core_Model_Store->isCurrentlySecure()
#2 /home/dan/workspace/magento1610/app/code/core/Mage/Core/Controller/Varien/Front.php(161): Mage_Core_Controller_Varien_Front->_checkBaseUrl(Object(Mage_Core_Controller_Request_Http))
#3 /home/dan/workspace/magento1610/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch()
#4 /home/dan/workspace/magento1610/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#5 /home/dan/workspace/magento1610/index.php(80): Mage::run('', 'store')
#6 {main}";s:3:"url";s:85:"/index.php/admin/system_config/edit/section/web/key/41c8c3d3f4bcb72e3c267ae0b73333d7/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}
Bug reports on Magento’s site here, here, here and here. Not being patient enough for Varien to fix it, I developed a small extension which resolves the problem. It’s available to download below.
Put the tarball in the Magento webroot and extract. After you install this extension, you’ll need to empty the cache manually (if it was enabled). I assume if you’re reading this, then your Magento installation is broken. To do this, simply remove the contents of var/cache in Magento’s webroot.
When you re-visit your Magento’s front or backend, the problem should vanish.
[download id=”24″ format=”7″]
Updated 9th January 2012: It apparent that, attempting to login before applying this update with {{base_url}} set screws up the admin login cookies somehow. When you apply this patch, you’ll probably need to empty out your chosen browser’s cookie jar before attempting to login. You can tell if you need to or not by trying to login, and Magento coming back to you with a login screen, with no failed login message.
Updated 12th January 2012: Magento 1.6.2.0 was released today. I can confirm that this problem still exists and has not yet been fixed (despite what the developers have written on one of the bug reports).
Updated 25th April 2012: I can confirm that this problem has been resolved in the latest 1.7.0.0 version, released 24th April 2012.
Hello,
I still can’t login even after clearing the var/cache folder and my browser (google chrome). Any idea as to what may be going?
It’s strange because I was able to log in using safari. Google Chrome however, not so much.
Work’s perfect. Thanks
It did it for me. And now for the next bug to solve…
Thank you so much for this!
Worked, thank you!
Much appreciated.. thanks
Thank you for this fix, at-last my instance of magento is running on windows machine after.
Thanks, this update fixed the bug on my installation.
Great work!
Amazing! This worked like a charm. I wish I was this good at fixing Magento! Great job and thank you!!!
Nice job! Now the magento can work, thanks.
Thank you very much for this great post. I’hv finally installed magento in my localhost.
Also need a little help on installing the sample data. Still i’m unable to import. Every time it’s exceeding mysql execution time limit. Can you please help me to resolve this issue?
That worked for me, thank you very much!
Really Thank..
its work for me …
thank you again
vivek
Thank you!!
I am happy to post a thanks for you.Cheers..
http://www.licindiasite.com
First time user of Magento and installed on Wampserver and loaded sample data. Then couldn’t login into admin store and then finally the error reported as above. I’m not clear on how to install the tz extension on Wampserver. Any assistance would be apprecieated. Cheers.
So useful ! Thank’s
I had to share it !
nice post. thanx
Tks dude! Really works for me !
Tks dude really works for me !
thanks!!!
It worked for me. Thanks…
thank you so much!!!! it worked for me!!!
thanks for this fix. Could not find a solution on the magento forums :S
Thank You!!!!!
Hi,
Thank you for this. It worked for me 🙂
Akshay.
thank you, this fix works for me
This is not working with 1.6.2!
Clear browser cookies, remove cache and install update but still login screen coming back.
No success for far!
man, are you the man! you save my life!!!!
Great! thank you
Very good.
very good
Excellent – saved me!
This bug is back in 1.7.0.2 and your fix still works for it.
Aloha for the save!
i did the same i uploaded all files from your zip file ..since admin and front end not working so simply uploaded from FTP
still same .. http://www.giftistic.com
any advice please
@pankaj;
This plugin is only for resolving the use of {{base_url}} in the base secure and unsecure URL fields in Magento’s admin for development purposes. It looks like your store isn’t configured with {{base_url}}, so this extention won’t help you.
What value do you have in your base_secure_url and base_unsecure_url (search the core_config_data table for ‘path LIKE “web/%secure/base_url”‘)? They should be in the form “http://www.giftistic.com/” and “https://www.giftistic.com/”. If it’s not these, change them, then you’ll need to flush Magento’s caches manually, by simply removing the contents of var/cache. If you use memcached or APC you’ll need to flush that too.