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
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
- https://github.com/opencart/opencart/bl ... anager.php
- https://github.com/opencart/opencart/bl ... nager.twig
Clear all caches after. Good luck
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
>>>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.
Attachments
Image Upload is showing plain box. - Screenshot (429).png (48.51 KiB) Viewed 3395 times
Image Upload is showing plain box. - Screenshot (428).png (50.97 KiB) Viewed 3395 times
Warning: Directory does not exist! - Screenshot (425).png (51.21 KiB) Viewed 3395 times
Please post your config.php and admin/config.php files without password information.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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/');
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/');
Reason: Added code tags.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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
Reason: Added code tags.
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'));
Code: Select all
// Check its a directory
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.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
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
define('DIR_IMAGE', '/home/techdeli/public_html/image/catalog');
This also did'nt worked.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
/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
Code: Select all
if (!is_dir($directory)) {
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
I understand the frustration that this situation may cause. However, please do not to use constant caps on the forum.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
line 39
Code: Select all
if (substr(str_replace('\\', '/', realpath($directory) . '/' . $filter_name), 0, strlen(DIR_IMAGE . 'catalog')) == str_replace('\\', '/', DIR_IMAGE . 'catalog')) {
Code: Select all
if ( 1 || substr(str_replace('\\', '/', realpath($directory) . '/' . $filter_name), 0, strlen(DIR_IMAGE . 'catalog')) == str_replace('\\', '/', DIR_IMAGE . 'catalog')) {
Code: Select all
if (!is_dir($directory) || substr(str_replace('\\', '/', realpath($directory)), 0, strlen(DIR_IMAGE . 'catalog')) != str_replace('\\', '/', DIR_IMAGE . 'catalog')) {
Code: Select all
if (!is_dir($directory)) {
Code: Select all
if (!is_dir($directory) || substr(str_replace('\\', '/', realpath($directory)), 0, strlen(DIR_IMAGE . 'catalog')) != str_replace('\\', '/', DIR_IMAGE . 'catalog')) {
Code: Select all
if (!is_dir($directory)) {
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')) {
Code: Select all
if ($path == DIR_IMAGE . 'catalog') {
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Users browsing this forum: No registered users and 135 guests