Troubleshooting OpenCart’s .htaccess file Pt. 2

    Fumbling through support tickets is always an interesting task. You can come across situations you’ve never thought of. Like it happened to us, just yesterday.

    What happened?

    The server refused to execute a php file , which prevented OpenCart Mobile Framework from displaying styles on the mobile page of the webshop. We’ve had this problem before, but we had to look for a brand-new solution. Then we left it for the night and it solved itself. Kind of. :-)

    Internal server error 500

    Server issues are a dark place. But a beam of the right knowledge will always save you. So, where does this error come from?

    Odd file/directory permissions on your server.

    This was the correct answer in our situation!
    A customer had just restored a backup of OpenCart. For some strange reason, the rights to the “catalog” directory were set to 777 (Full access to everyone). So, be sure to check that when you get “Internal server error 500” and set the directories’ rights to 755(read and execute) or 644(read only), whichever is appropriate.

    An .htaccess issue.

    Often the solution is hidden within this very file. Before I try anything else, I always disable all .htaccess files down the problematic path, or, at least the one in the root directory of the OpenCart installation.
    If you’ve found that this is your problem, look closely at the code—rewrite rules will usually trip you. In a previous attempt to solve the same problem with the aforementioned php file, the following line added to the root .htaccess did the magic:
    RewriteCond %{REQUEST_FILENAME} !^(.+).php$
    This is, of course, if apache’s rewrite engine is on.

    A problem with php.ini.

    This is an unlikely issue, but, when troubleshooting, every possible cause has to be taken into account. So, rename the php.ini to see if it is the problem. And then, armed with clarity, google for your issue again.

    Receive a curated list of the best OpenCart tips & tricks

    Delivered in your inbox weekly for free.

    More OpenCart Tutorials

Leave a Reply

Your email address will not be published. Required fields are marked *