it's my blog anyway
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.
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:
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.
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.
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.
4 Responses to How to fix the “Illegal scheme supplied, only alphanumeric characters are permitted” Magento error on Localhost using HTTP (fresh install)
AK
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?
Richard Feraro
November 4th, 2011 at 7:03 am
What is your error when logging in to admin using https?
Linish
January 15th, 2012 at 2:01 am
Gr8 fix man. Worked Perfectly!
Richard Feraro
January 15th, 2012 at 7:52 am
Thank you