Page 1 of 1
Image manager issues 3.0.2.0
Posted: Mon Nov 13, 2017 6:00 pm
by Busyhand
Hi,
Can someone please help me!!
I am having problems with image manager on my new opencart 3.0.2.0 I keep getting the warning directory does not exist
I have been through all the forums possible and tried everything possible to fix but am getting know where. I have changed the permissions to 775 and 777 on the image file and catalog but still no go. I have also checked the config file for the path and it all looks ok.
I am quite a novice at all this so if someone could tell me how to fix in straight forward language I would be most grateful.
Andrew
Re: Image manager issues 3.0.2.0
Posted: Tue Nov 14, 2017 12:10 am
by straightlight
Follow these instructions and see if that resolves the issue:
viewtopic.php?f=199&t=199580 . Also check your access logs from your FTP or from your host console after following these steps noticing if new lines are appearing when attempting to use the File Manager.
Re: Image manager issues 3.0.2.0
Posted: Wed Nov 15, 2017 5:10 am
by Busyhand
Hi Straightlight,
I have gone to that link and it has nothing to do with the issues I'm having with image manager and directory does not exist!
Can anyone else help me please?
Andrew
Re: Image manager issues 3.0.2.0
Posted: Wed Nov 15, 2017 5:37 am
by straightlight
I don't know the browser pastes the wrong topic but anyways. Followed are the links you can try:
-
https://github.com/opencart/opencart/bl ... anager.php
-
https://github.com/opencart/opencart/bl ... nager.twig
Clear all caches after. Good luck
Re: Image manager issues 3.0.2.0
Posted: Fri May 01, 2020 8:25 pm
by Ankit11188
I've tried replacing above said files -
>>>opencart/upload/admin/view/template/common/filemanager.twig
>>>opencart/upload/admin/controller/common/filemanager.php
also my config.php files are having correct images path.
Image Manager is saying "Warning: Directory does not exist!", refer to attachment screenshots, there is no any image visible on website storefront, whereas website LOGO is the only image visible on default template of opencart Version 3.0.3.2. All this happened after i upgraded from opencart 1.5.6.4.
Is there any way how this can be resolve i've tried a lot.
Refer to 3 screenshot attachments.
Re: Image manager issues 3.0.2.0
Posted: Fri May 01, 2020 9:11 pm
by straightlight
Did you cleared your OC cache after replacing those files by following this FAQ:
viewtopic.php?f=134&t=215776#p718325
Please post your config.php and admin/config.php files without password information.
Re: Image manager issues 3.0.2.0
Posted: Sat May 02, 2020 1:30 am
by Ankit11188
Hi,
Yes i've cleared OC cache, then also issue is the same.
I've provided files, please take a look.
----------------------------config.php--------------------------------------
Code: Select all
<?php
// HTTP
define('HTTP_SERVER', 'http://techdeli.com/');
// HTTPS
define('HTTPS_SERVER', 'http://techdeli.com/');
// DIR
define('DIR_APPLICATION', '/home/techdeli/public_html/catalog/');
define('DIR_SYSTEM', '/home/techdeli/public_html/system/');
define('DIR_DATABASE', '/home/techdeli/public_html/system/database/');
define('DIR_LANGUAGE', '/home/techdeli/public_html/catalog/language/');
define('DIR_TEMPLATE', '/home/techdeli/public_html/catalog/view/theme/');
define('DIR_CONFIG', '/home/techdeli/public_html/system/config/');
define('DIR_IMAGE', '/home/techdeli/public_html/image/');
define('DIR_STORAGE', '/home/techdeli/storage/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
----------------------------admin/config.php--------------------------------------
Code: Select all
<?php
// HTTP
define('HTTP_SERVER', 'http://techdeli.com/admin/');
define('HTTP_CATALOG', 'http://techdeli.com/');
// HTTPS
define('HTTPS_SERVER', 'http://techdeli.com/admin/');
define('HTTPS_CATALOG', 'http://techdeli.com/');
// DIR
define('DIR_APPLICATION', '/home/techdeli/public_html/admin/');
define('DIR_SYSTEM', '/home/techdeli/public_html/system/');
define('DIR_DATABASE', '/home/techdeli/public_html/system/database/');
define('DIR_LANGUAGE', '/home/techdeli/public_html/admin/language/');
define('DIR_TEMPLATE', '/home/techdeli/public_html/admin/view/template/');
define('DIR_CONFIG', '/home/techdeli/public_html/system/config/');
define('DIR_IMAGE', '/home/techdeli/public_html/image/');
define('DIR_STORAGE', '/home/techdeli/storage/');
define('DIR_STORAGE', '/home/techdeli/storage/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_CATALOG', '/home/techdeli/public_html/catalog/');
------------------------------------------------
Re: Image manager issues 3.0.2.0
Posted: Sat May 02, 2020 2:26 am
by straightlight
Ok. Now, please post your .htaccess file with code tags.
Re: Image manager issues 3.0.2.0
Posted: Sat May 02, 2020 4:56 pm
by Ankit11188
----------------.htaccess.txt --------------------
Code: Select all
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
# 2. In your opencart directory rename htaccess.txt to .htaccess.
# For any support issues please visit: http://www.opencart.com
Options +FollowSymlinks
# Prevent Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|.twig|\.ini|\.log|(?<!robots)\.txt))">
Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch>
# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.
# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off
# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off
# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M
# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M
# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200
# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200
# 7. disable open_basedir limitations
# php_admin_value open_basedir none
Re: Image manager issues 3.0.2.0
Posted: Sat May 02, 2020 5:18 pm
by letxobnav
admin/controller/common/filemanager.php
put these
Code: Select all
$this->log->write('filemanager upload');
$this->log->write('this needs to be a valid directory: '.$directory);
$this->log->write('this: '.substr(str_replace('\\', '/', realpath($directory)), 0, strlen(DIR_IMAGE . 'catalog')));
$this->log->write('needs to equal this: '.str_replace('\\', '/', DIR_IMAGE . 'catalog'));
right after
in
function upload()
then you can see in your OC error log why it believes it is not a valid directory.
realpath tends to give different results on different installations.
Re: Image manager issues 3.0.2.0
Posted: Sat May 02, 2020 6:49 pm
by Ankit11188
Hi, thanks for response, i've received this inside error log, but don't know how to proceed, i need guidance. Below stated are error logs -
Code: Select all
2020-05-02 10:26:26 - filemanager upload
2020-05-02 10:26:26 - this needs to be a valid directory: /home/techdeli/public_html/image/catalog
2020-05-02 10:26:26 - this: /home/techdeli/domains/techdeli.com/
2020-05-02 10:26:26 - needs to equal this: /home/techdeli/public_html/image/catalog
2020-05-02 10:29:54 - filemanager upload
2020-05-02 10:29:54 - this needs to be a valid directory: /home/techdeli/public_html/image/catalog
2020-05-02 10:29:54 - this: /home/techdeli/domains/techdeli.com/
2020-05-02 10:29:54 - needs to equal this: /home/techdeli/public_html/image/catalog
Later on when this didn't worked i also tried modifying DIR inside config.php and admin/config.php
define('DIR_IMAGE', '/home/techdeli/public_html/image/catalog');
This also did'nt worked.

Re: Image manager issues 3.0.2.0
Posted: Sat May 02, 2020 7:31 pm
by straightlight
Ensure your root image/catalog folder does exist. If so, then ensure the install.txt documentation file has been followed regarding folder permissions which can be found in the downloaded ZIP file from opencart.com prior on installing Opencart.
Re: Image manager issues 3.0.2.0
Posted: Sat May 02, 2020 8:22 pm
by letxobnav
your host uses symbolic links to map
/home/techdeli/public_html/
to probably
/home/techdeli/domains/techdelivers.com/
The function realpath() returns the canonicalized absolute pathname stripped of any symbolic links, i.e. the actual physical path the symbolic link points to.
So when OC compares the two, they will not match, why they are compared to determine if it is a valid directory is beyond me, just checking if realpath returns true is enough to determine if the actual directory exists for that symbolic link.
I would simply remove the additional check and just leave
Re: Image manager issues 3.0.2.0
Posted: Sun May 03, 2020 1:06 am
by Ankit11188
Nothing worked.
Re: Image manager issues 3.0.2.0
Posted: Sun May 03, 2020 1:59 am
by straightlight
Ankit11188 wrote: ↑Sun May 03, 2020 1:06 am
Nothing worked.
I understand the frustration that this situation may cause. However, please do not to use constant caps on the forum.
Re: Image manager issues 3.0.2.0
Posted: Sun May 03, 2020 9:41 am
by letxobnav
admin/controller/common/filemanager.php
line 39
Code: Select all
if (substr(str_replace('\\', '/', realpath($directory) . '/' . $filter_name), 0, strlen(DIR_IMAGE . 'catalog')) == str_replace('\\', '/', DIR_IMAGE . 'catalog')) {
change to
Code: Select all
if ( 1 || substr(str_replace('\\', '/', realpath($directory) . '/' . $filter_name), 0, strlen(DIR_IMAGE . 'catalog')) == str_replace('\\', '/', DIR_IMAGE . 'catalog')) {
line 209 ( you did already? )
Code: Select all
if (!is_dir($directory) || substr(str_replace('\\', '/', realpath($directory)), 0, strlen(DIR_IMAGE . 'catalog')) != str_replace('\\', '/', DIR_IMAGE . 'catalog')) {
change to
line 304
Code: Select all
if (!is_dir($directory) || substr(str_replace('\\', '/', realpath($directory)), 0, strlen(DIR_IMAGE . 'catalog')) != str_replace('\\', '/', DIR_IMAGE . 'catalog')) {
change to
line 355
Code: Select all
if ($path == DIR_IMAGE . 'catalog' || substr(str_replace('\\', '/', realpath(DIR_IMAGE . $path)), 0, strlen(DIR_IMAGE . 'catalog')) != str_replace('\\', '/', DIR_IMAGE . 'catalog')) {
change to
Code: Select all
if ($path == DIR_IMAGE . 'catalog') {
Re: Image manager issues 3.0.2.0
Posted: Sun Nov 06, 2022 8:25 pm
by Li-on
Hello!
I want to say THANK YOU as these changes helped me fix my file manager.
