"Illegal scheme supplied, only alphanumeric characters are permitted" Magento

"Illegal scheme supplied, only alphanumeric characters are permitted" Magento

September 8, 2026 · Illustrated author avatarBy Stefan Bogdanescu
"Illegal scheme supplied, only alphanumeric characters are permitted" Magento

Resolving the “Illegal scheme supplied” Error in Magento

If you’re facing the frustrating “Illegal scheme supplied, only alphanumeric characters are permitted” error in your Magento site after months or years of smooth operation, don’t despair - there’s a solution. Let’s dive into understanding this issue and how to fix it effectively.

The Underlying Problem: Database Connection Failure

Before we get into the technical aspects, let me assure you that this is likely not a base_url configuration issue. Since your site worked perfectly for years and the problem suddenly emerged on both of your Magento sites hosted on the same webspace, we can rule out a misconfigured URL.

Instead, I suspect a database connection problem. Here’s why:

  1. The error message suggests that Magento is expecting an alphanumeric scheme but getting something else.
  2. The simultaneous impact on two sites points to a shared resource issue, like a database server.
  3. A sudden failure after long-term stability indicates a hardware or software glitch rather than a code change.

Troubleshooting the Database Connection

To verify this hypothesis, let’s start by checking your Magento database connection settings in the app/etc/local.xml file:

<config>
  <global>
    <install date="Wed Sep 08 12:47:35 CEST 2021">
      <schema_version>1.6.0.0</schema_version>
    </install>
    <resources>
      <db>
        <table_prefix>mg_</table_prefix>
        <connection>
          <host><![CDATA[localhost]]></host>
          <username><![CDATA[magentouser]]></username>
          <password><![CDATA[magento1234!]]></password>
          <dbname><![CDATA[magonlinedb]]></dbname>
          <act_as_default>1</act_as_default>
        </connection>
      </db>
    </resources>
  </global>
</config>

Ensure the host, username, password, and database name are accurate. If everything looks correct, it’s time to check if your database server is reachable.

Testing Database Connectivity

Log into your MySQL server using a tool like phpMyAdmin or the MySQL client:

mysql -u magentouser -p magonlinedb

If you can connect successfully and see tables related to Magento, your connection is likely fine. If not, there could be a network issue preventing communication between your webserver and database server.

Load Balancing or Resource Overload

In the case where both sites are affected simultaneously, consider if any recent changes were made to the server infrastructure:

  • Did you add a new load balancer?
  • Was there an update to the server’s operating system or PHP version?
  • Are there any unusually high traffic spikes or resource demands?

These factors could cause temporary connection failures. In most cases, however, I find that hardware or software issues at the database level are the culprit.

Conclusion: Contact Your Hosting Provider

Given the shared nature of both sites and the sudden onset of the issue, my recommendation is to reach out to your web hosting provider immediately. They have access to server logs and can investigate potential network or hardware problems causing intermittent database connection failures.

Remember, Magento relies heavily on its database connection, so any interruptions will result in this type of error. Your hosting provider should be able to diagnose the problem and restore stability quickly.

For more insights into debugging Magento issues like this one, check out our guide to common Magento performance problems.

Don’t hesitate to reach out if you need further assistance in resolving this issue.

Database Configuration Errors

Our network