Can anyone confirm that symlinks in the config paths don't work?
If I set DIR_IMAGE to:
/var/www/mysite/releases/1/public/images/
It works. But if I use my symlink (current => releases/1) it doesn't load images:
/var/www/mysite/current/public/images/
I have double checked the paths & permissions, it's not that.
This is frustrating because many deployment tools use this kind of symlink to latest release strategy.
Thanks!
If I set DIR_IMAGE to:
/var/www/mysite/releases/1/public/images/
It works. But if I use my symlink (current => releases/1) it doesn't load images:
/var/www/mysite/current/public/images/
I have double checked the paths & permissions, it's not that.
This is frustrating because many deployment tools use this kind of symlink to latest release strategy.
Thanks!
No it doesn't work. See: https://github.com/opencart/opencart/is ... -445496224
We often use an 'image' link defined in the admin folder which points to the 'image' folder. This makes it easier with the admin backend's summernote editor to show the images.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
You could use hard links.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Guru Member
I just run a little PHP script one time from the admin folder to create a symbolic link:
Works with most webhosts.
Code: Select all
<?php
$target = '/home/xxxxx/public_html/image';
$shortcut = 'image';
symlink($target, $shortcut);
?>
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
For anyone having a similar problem if you use versioned deployments. I worked around this problem by having the 2 config files (public/config.php and public/admin/config.php) parse the real path from the symlink like so:
Code: Select all
// WorkAround - OpenCart doesn't support symlink paths. Let PHP extract the actual path using readlink().
define('DEPLOY_PATH', readlink('/var/www/mysite/deploy/current') . '/');
// DIR
define('DIR_APPLICATION', DEPLOY_PATH . 'public/catalog/');
define('DIR_SYSTEM', DEPLOY_PATH . 'public/system/');
define('DIR_IMAGE', DEPLOY_PATH . 'public/image/');
define('DIR_STORAGE', DEPLOY_PATH . 'storage/');
Who is online
Users browsing this forum: NicNie and 214 guests