How to fix common OpenCart issues
My whole life I’ve been spending a considerable percentage of my web development projects time dealing with errors rather than enjoying the coding part. Rare are the projects I had to accomplish without coming across an unexpected error or bug. Sometimes the fix is easy and other times it is a hopeless cause. Especially when you’re working with a framework like OpenCart.
It’s not uncommon to me to face a familiar issue that I managed to correct in the past. I can simply apply the same fix. The problem is, I have to remember how I fixed it in the first place. This has made me mad more than once but today I am putting an end to it. I decided to write this page as a way for me to keep note of the issues I face the most on OpenCart and how I fixed them, in the second plan, I hope it will save the time of some of you so you can spend it on a more productive work.
I will keep updating this page each time I come across a common Opencart issue and fix it.
OpenCart Installation & Update Issues:
1.Install infinite loop
if you searched this on Google then you’ve come to the right place:
install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/index.php
this is how your url looks like if your OpenCart store is stuck in infinite loop during install:

These issues happen mostly when you open your OpenCart store url for the first time. Like when you try to install OpenCart or upgrade it to a newer version. The store enters in an infinite redirect loop and ends up by displaying a ERR_TOO_MANY_REDIRECTS error page. But in some rare cases this can suddenly happen to your store even if it has been running before. In this case you should preferably try to restore your website to a previous backup or find out what has changed since the last working version.
This issue is supposed to happen only when one is trying to install or upgrade opencart which means that you may have lost some important files on your OpenCart directory, or what’s left from your store is maybe pointing to the wrong location.
if you get this issue upon install or update then this is how to deal with it:
Browser re-directions cache:
Make sure your browser’s cache isn’t interfering. Clear it up, or try on a different browser or a different device. Just begin by testing your page as far as possible from your usual browser.
if you obtain a different result then focus on clearing your browser’s cache before you proceed further. Browser’s cache can still interfere when you try the following steps too so keep in mind that you need to clear your cache each time you try a new solution. You don’t want to pass by the solution because of this ridiculous exception.
Try adding “upload” to the url
if you’re trying to install OpenCart using this url: yoursite.com then try accessing it from here instead: yoursite.com/upload
If it works then you’ve done something wrong when you extracted the installation compressed file. So stop just there because that installation has been made on a wrong basis.
You probably placed the folder upload inside your store’s root directory. What you have to do is simple: move all the upload folder’s content to the parent directory. In other words move all the upload folder’s files to your store’s root directory
disable the .htaccess file temporarily
This file may contain some redirection rules that causes a conflict which prevents the installation process from starting correctly. look for the file and disable it by renaming it temporarily. Some ftp clients hides it by default so you need to perform an extra step in order to find it. it should be in the directory of your store.
2.Uncaught TypeError: Argument 2 passed to Event::trigger() must be of the type array, string given..
this is the full error message:
Fatal error: Uncaught TypeError: Argument 2 passed to Event::trigger() must be of the type array, string given, called in xxx/system/storage/modification/system/engine/loader.php on line 140 and defined in xxx/system/engine/event.php:59 Stack trace: #0 xxx/system/storage/modification/system/engine/loader.php(140): Event->trigger('language/en-gb/...', 'en-gb') #1 xxx/system/framework.php(136): Loader->language('en-gb') #2 xxx/system/startup.php(104): require_once('xxx/...') #3 xxx/install/index.php(37): start('install') #4 {main} thrown in xxx/system/engine/event.php on line 59
I got this issue when I tried to upgrade from OpenCart 2 to 3. In my case it was related to extensions so I had to disable each one of them before proceeding to update. But after I started the installation process It was too late because I had no more access to the admin panel. If you’re in the same position than try this:
Disable OCMod extensions using FTP:
You can also use the file manager of your host account to perform this. Simply rename the folder system/storage/modification to a different name like system/storage/modification_temp. This will temporarily disable all your old OCMod extensions. But don’t forget to create a new empty folder with the same name modification because OpenCart will need that in order to proceed with the installation. Once the installation is done you can enable your extensions again. You preferably need to do that one extension at a time. That way you’ll be able to know which one of your extensions is responsible of a any potential error.
Disable OCMod extensions from database:
If the previous solution didn’t work then you may perform this as an extra step. You need to access your database from your host panel. Look for phpmyadmin or a similar tool, then access the oc_modification table on your OpenCart’s database. There you should find all your extension. You can disable them by changing each row’s status col value to 0
or you can simply execute this mySql query which will do the work for you automatically:
update `oc_modification` set status=0
Make sure to replace oc_modification by the correct name of your current table. The table may have a different prefix like mysite_ instead of oc_, in this case the query should be:
update `mysite_modification` set status=0
3.Warning: fopen(/storage/cache/cache.catalog.language.): failed to open stream: No such file or directory in xxx/system/library/cache/file.php on line 49
I faced this issue after installing OpenCart 3 and trying to move the “storage” folder outside its initial directory as per Opencart’s suggestion. After you install OpenCart 3 and you access your admin panel, a popup (Importan Security Notification) will appear with the following message: ” It is very imporant that you move the storage directory outside of the web directory (e.g. public_html, www or htdocs).”

Now the problem may also in case you clicked on “move” and the process didn’t go well. or if you tried to move the directory manually in an incorrect way. In both cases here’s what you need to make sure of:
Make sure the folder “storage” is in the right location
In the very beginning, the directory storage is supposed to be in the system directory right within your root directory but its location should change according to the OpenCart system notification. Therefore it should move to the root directory. In other words move the system/storage folder to the parent folder, your root directory should now look like:
Make sure the config.php files are pointing to the right location
Opencart has two config.php files: one is location within the root directory and the other inside the admin directory. Both files has paths that points to the storage directory and you need to make sure that the paths are corrects, in order to do this, edit both files and change this line:
define('DIR_STORAGE',....
to this;
define('DIR_STORAGE', '/storage/');
But this might not work sometimes. Because the paths are relative so the root folder may sometime be longer than a simple slash ( / ). The trick here is to find the absolute path to your root directory. It can be something like /usr/www/users/xxxx/ or /home/xxxx/public_html … depending on your host provider so in order to be sure just copy the path from the config.php file itself, see the picture below:
4. Warning: fopen(xxxxx/storage/logs/openbay.log): failed to open stream: No such file or directory in xxxxx/system/library/log.php on line 22
This issue may happen if you have got the popup Important Security Notification on your admin panel (see issue 3) and you clicked on the red move button but it didn’t go well. If this is the case then using your ftp client or your host file manager go and take a look at the storage folder within your root directory and make sure its content looks like this:
if you have a different content, like missing folders than it means that the storage directory hasn’t been moved correctly by OpenCart that’s why you need to do it manually so just delete the incomplete storage folder from your root directory then move the original one that you should find within the folder system then place it where the previous storage folder (the one you deleted previously) was located (the root directory), read the issue 3 for more information about this process.
5.Warning: fopen(xxxx/catalog/view/theme//stylesheet/bootstrap.css): failed to open stream: No such file or directory in xxxxx/catalog/controller/startup/sass.php on line 14
this rare issue happens when OpenCart tries to load your theme name from the database without results, that’s why the link is inccorect : xxxx/catalog/view/theme//stylesheet/bootstrap.css
so in order for the file to load correctly, the path should look like:
xxxx/catalog/view/theme/default/stylesheet/bootstrap.css for example
so this is how to force OpenCart to display the correct theme name:
Save your theme from the admin panel
open the admin panel and go to extensions>extensions then chose theme in the drop-down , a list of your installed themes should appear:
click on the blue edit button located in the same row as your active theme (the one with “enabled”) then without even making any specific modification just save and go test if that has resolved the issue.
make sure your oc_settings table is correct
this solution is tricky because I don’t have a code you can just copy past somewhere into your code or phpmyadmin, you need to open your phpmyadmin and compare your oc_settings table to a correct one, I fixed mine by importing a freshly created OpenCart 3 oc_settings table into my store’s database, by replacing my incorrect table with the correct one, the issue was gone but be careful because this means you’ll have to lose your old settings, I didn’t mind setting everything like it was manually as this would take less time than looking for a solution that would save my previous settings.
6. No input file specified
After installation, your store is redirecting you back to the install page with a message saying “No input file specified”, this problem is related to php and can be resolved by adding this line to your php.ini file:
cgi.fix_pathinfo = 1;
the php.ini file can be found in your website root folder. If it is not there. You can create one and add that line inside it.
Opencart Admin Panel Issues
1. Warning: You do not have permission to access the API!
Have you tried to edit or delete an order on your opencart system without any success? if you’re getting a message like:

chances are you don’t have permissions to access opencart’s api but don’t panic this should be a simple fix.
Make sure your ip address is authorized in the API section
login to your panel and go to System>Users>API

click on edit and go to IP Addresses and add your ip address there then save.
this should be the most common reason why you can’t delete or edit your orders but if it doesn’t work try the next suggestion.
Make sure your user group has all the permissions
The administrator group is supposed to have all the permissions by default but give it a look in case it has changed somehow.
go to System>User>User Groups

make sure all Access Permissions and Modify Permissions are checked, check them if not then save.
Disable API IP checks once and for all
if you have a dynamic IP the previous solutions might not suit you as you have to reproduce them each time your ip changes, so instead of adding your ip manually each time you can just apply this solution which will relief you once and for all from this annoying task;
simply install this extension and it will do the work for you automatically, don’t forget to clear your store’s cache after install.
2.Notice: Trying to access array offset on value of type null in /storage/vendor/scss.inc.php on line 1753
This issue suddenly started showing up when I try to access my opencart admin panel. In order to fix it you need to change line 1753 of the file scss.inc.php
If like me, this error message unexpectedly started appearing in admin panel login page, then your hosting provider has probably updated your server php version.
You can find the file in the /storage/vendor/ directory.
The initial line of code should look like
$key = $key[1];
and in order to get rid of the error message you need to replace it with this:
$key = isset($key[1]) ? $key[1] : null;
3. Unknown: Array and string offset access syntax with curly braces is deprecated
This error message popped up to me when I tried to go to the settings page, as you might guess this is nothing but a php 8 compatibility error and can be fixed easily. All you have to do is to edit the file indicated by the error message. In my case it was /system/library/kadb.php on line 66.
if (!(($k{0} == '`') && ($k{strlen($k) - 1} == '`'))) {
What you have to do is to replace the curly braces for arrays in that line by brackets
if (!(($k[0] == '`') && ($k[strlen($k) - 1] == '`'))) {
Opencart Checkout Issues
The checkout page is where people connect their payment cards. There’s no worse place for errors to occur.
1. There was an error fetching the PayPal token

This error message used to show up in my client’s OpenCart store checkout page. People were not able to pay through paypal express when they reach step 4: Confirm Order.
This issue happens because you’re using the paypal express extension which has stopped from working. You have to install the new paypal extension called PayPal Commerce Platform Integration
First, connect to your opencart account and download the extension zip file.
Then, go to your OpenCart admin>Extensions>Installer and upload the file you just downloaded.
After that, go to Extensions>Extensions and select payments from the filter. Look for PayPal Commerce Platform and click on the plus button to install it. Click now on the pencil button to edit the extension. In here you need to change the status to enabled and connect your store’s paypal account. Your clients can now pay through paypal without a problem.
Finally, don’t forget to disable and uninstall the PayPal Express Checkout extension as it is no more needed.
Buongiorno
GRAZIE
Con il vostro aiuto sono riuscito a risolvere il problema della fastidiosa finestra:
Make sure the folder “storage” is in the right location.
GRAZIE SALUTI
Thank you very much, that did it for me