Latest Articles
So far this was never an issue, there were problems with uploading modules via the installer because of the ftp connection but you could allways install ocmods without any issue. However, some .. Read More
People had this issue so many times I thought I would write a bit about it. The  types of issues with opencart's 2.x modification system that I identified so far are: 1. Old Vqmod .. Read More
This small tutorial will show you how to manually add custom links to the default top menu in opencart. If you dont want to go trough all the hustle and would like to be able to completly customize.. Read More
To enable seo urls in opencart navigate in admin to system > settings , edit the store and on the server tab of the store settings you will find "Use SEO urls", set it to yes. So far e.. Read More
All Articles

Can't install ocmods trough the opencart extension installer

So far this was never an issue, there were problems with uploading modules via the installer because of the ftp connection but you could allways install ocmods without any issue.

However, some automated cpanel installers instead of solving the previous issues they created on opencart installations, now they add even more.

If you are trying to upload .ocmod.xml files via the extension installer and you get an error like this one:

SyntaxError: Unexpected token < in JSON at position 0

Warning: mkdir(): No such file or directory in ../admin/controller/extension/installer.php on line 82 Warning: move_uploaded_file(../install.xml): failed to open stream: No such file or directory in ../admin/controller/extension/installer.php on line 93 Warning: move_uploaded_file(): Unable to move '...tmp' to '../system/upload/temp-long-code/install.xml' in ../admin/controller/extension/installer.php on line 93{"step":[],"overwrite":[],"error":"File could not be found!"}

You need to check your config files because they are most likely missconfigured

You may notice in the above error the path ../system/upload/temp-long-code/install.xml. But system/upload is not the real path of the upload folder in opencart 2.1+, it is actually system/storage/upload. So the config files are missing a folder from the path and that creates the issue.

To solve it, you need to  edit the admin/config.php and the root config.php files.

Once you open the files you might notice that not only the DIR_UPLOAD contant is incorrect but DIR_CACHE, DIR_DOWNLOAD, DIR_LOGS and DIR_MODIFICATION as well.

Their values is made by concatenating the DIR_SYSTEM value with their folder name:

define('DIR_UPLOAD', DIR_SYSTEM . 'upload/');

And you need to add the storage folder before the actual folder name, like this:

define('DIR_UPLOAD', DIR_SYSTEM . 'storage/upload/');

Dont forget that you need to do this for the other constants mentioned above as well, and in both the admin config.php and the root one.

After you corrected the mistakes, save the files and you should be ok. While you're at it make sure the root config.php doesnt have a DIR_CATALOG constant in it, you can read more about that issue in the below article.

Posted by Flo

Related Articles

People had this issue so many times I thought I would write a bit about it. The  types of issues with opencart's 2.x modification system that I identified so far are: 1. Old Vqmod version installed which doesnt support ocmod 2. Ocmod cache could not be written due to insufficient folder permission 3. The ocmod cache doesnt get loaded in frontend (ocmod works in admin but not in frontend) The most common I encountered is number 3 because it has to do with the opecart installation method. Some control panel software installers do not properly configure the ope..
0 comments on this article - view comments

5 Comments To "Can't install ocmods trough the opencart extension installer"

David Augustus On 09 Dec 2016
This solved the problem, thanks !! Reply to this comment
Brijesha On 30 Aug 2016
Cant install zip file using extnsion installer.. Fatal error: Call to undefined function zip_open() in admin/controller/extension/installer.php on line 120 Reply to this comment
Flo On 30 Aug 2016
Looks like in your case ftp is not enabled for php.
ALBERT EZE On 22 Aug 2016
I cant also -- syntaxError: Unexpected token<in JSON at position 0 ok <b>warning </b>:ftp_login(): Login authentication failed in <b>/home?firstmumsonline/public_html/contoller/extension /installer.php</b> on line <b>295</b>{"error":" Could not login as first"} Reply to this comment
Flo On 22 Aug 2016
Seems like you are trying to upload more than an ocmod. Make sure the ftp settings in admin > system > settings > ftp tab are correct.

Write a comment

Your Name:


Enter the code in the box below:

Your Comment:
Note: HTML is not translated!