How to fix the “Illegal scheme supplied, only alphanumeric characters are permitted” Magento error on Localhost using HTTP (fresh install)

In: Feeling guru|Techie Daw

1 Nov 2011
Advertisement

I want to setup a development environment for the Mage Enabler for WordPress plugin in my new desktop so I downloaded the latest copy of Magento Community Edition which is version 1.6.1.0 at the time of this writing. I used the sample data provided from the Magento download page and used all the default values.

Advertisement

Magento Installation Wizard

Everything went well during the installation except when I access the frontend (http://localhost/magento) and admin (http://localhost/magento/admin), I was greeted with the default error page like the one below:

The page itself is not helpful so I decided to check the content of the error log (htdocs\magento\var\report) record number 1742231029 which contains the following information:

a:5:{i:0;s:67:"Illegal scheme supplied, only alphanumeric characters are permitted";i:1;s:681:"#0 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Store.php(712): Zend_Uri::factory('{{base_url}}')
#1 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(313): Mage_Core_Model_Store->isCurrentlySecure()
#2 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(161): Mage_Core_Controller_Varien_Front->_checkBaseUrl(Object(Mage_Core_Controller_Request_Http))
#3 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(349): Mage_Core_Controller_Varien_Front->dispatch()
#4 C:\xampp\htdocs\magento\app\Mage.php(640): Mage_Core_Model_App->run(Array)
#5 C:\xampp\htdocs\magento\index.php(80): Mage::run('', 'store')
#6 {main}";s:3:"url";s:19:"/magento/index.php/";s:11:"script_name";s:18:"/magento/index.php";s:4:"skin";s:7:"default";}

As you can see, the cause of the error is the invalid config data format being passed during the start of a session. To fix this, we need to accomplish these tasks:

  1. Allow the admin panel to run on localhost by disabling the domain check.
  2. Fix the config data value.

Allow the admin panel to run on localhost.

You will need to follow the instructions in my previous post but instead of using HTTP, you must access the admin page via HTTPS after you applied the code changes.

Fixing the config data value.

Once you are able to access the admin panel using HTTPS, go to System > Configuration > General > Web. Make sure that you supply the proper value for the Base URL on both Unsecure and Secure tabs then save the changes. See my example below:

Clear your browser’s cache and also Magento’s cache by deleting all the contents (not the folder itself) of the cache directory (htdocs\magento\var\cache). At this point, you should be able to access the frontend and admin panel using HTTP protocol.

Advertisement

About the author

Richard Feraro is a PHP Developer living in Manila, Philippines. He has been programming for nine (9) years and working on different open source application mostly done in PHP and MySQL.

4 Responses to How to fix the “Illegal scheme supplied, only alphanumeric characters are permitted” Magento error on Localhost using HTTP (fresh install)

Avatar

AK INDIA

November 4th, 2011 at 3:55 am

I did the code change as you mentioned in your “previous post” but im not able to login using https. This might be because I did not enable SSL during installation.
Now I get Illegal scheme error on opening frontend as well as backend. Is there a way to enable SSL without admin page or do I have to install the damn thing again?

Avatar

Richard Feraro PHILIPPINES

November 4th, 2011 at 7:03 am

What is your error when logging in to admin using https?

Avatar

Linish AUSTRALIA

January 15th, 2012 at 2:01 am

Gr8 fix man. Worked Perfectly!

Avatar

Richard Feraro

January 15th, 2012 at 7:52 am

Thank you :)

Comment Form

About my blog

This is a programmer's blog. Whenever I encounter a difficult coding task, I make sure that I'll be able to share it here in the hope that others may find it useful. It's my way of giving back to the open source community who have been a great help to me as well.

Share This Post

or bookmark to your mobile

Bookmark: http://mysillypointofview.richardferaro.com/2011/11/01/how-to-fix-the-illegal-scheme-supplied-error-on-localhost-fresh-install/

Advertisement

WordPress + Magento

Proudly Pinoy!

Proudly Pinoy!

Recent Trackbacks

Archives

Disclaimer

All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer or my mom.

Viewers by Country

in India 3401 (21 %) 3934 (20 %)
us United States 2700 (17 %) 3507 (18 %)
gb United Kingdom 929 (6 %) 1182 (6 %)
de Germany 808 (5 %) 1011 (5 %)
nl Netherlands 571 (4 %) 710 (4 %)
fr France 516 (3 %) 655 (3 %)
ph Philippines 442 (3 %) 669 (3 %)
br Brazil 427 (3 %) 502 (3 %)
it Italy 343 (2 %) 438 (2 %)
es Spain 334 (2 %) 446 (2 %)
ca Canada 324 (2 %) 404 (2 %)
au Australia 321 (2 %) 378 (2 %)
vn Vietnam 289 (2 %) 369 (2 %)
pk Pakistan 279 (2 %) 305 (2 %)
cn China 256 (2 %) 345 (2 %)
ro Romania 241 (2 %) 292 (1 %)
ua Ukraine 234 (1 %) 298 (2 %)
id Indonesia 140 (1 %) 167 (1 %)
pl Poland 131 (1 %) 161 (1 %)
sg Singapore 126 (1 %) 171 (1 %)
Total Countries: 139
Total Visits: 15858
Total Pageviews: 19789