Andrejkov Posted December 26, 2022 Share Posted December 26, 2022 Hello, I have problem with regenerate thumbnails on my shop(PS 1.7.8). When i go to Design -> Image Settings -> regenerate thumbnails, I got error: "Cannot write "No picture" image to products images folder. Please check the folder's writing permissions." I tryed to change img/p/ permissions to chmod 777, but i have still this error. What i can do to fix it? Regards. Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 26, 2022 Share Posted December 26, 2022 Hello, Did you try by setting the permission to 755 or 705? Link to comment Share on other sites More sharing options...
Andrejkov Posted December 28, 2022 Author Share Posted December 28, 2022 On 12/26/2022 at 1:37 PM, PrestaServicePro said: Hello, Did you try by setting the permission to 755 or 705? Hello, Yes, and it doesn't work for me. Link to comment Share on other sites More sharing options...
ps8modules Posted December 28, 2022 Share Posted December 28, 2022 Hi. Permission 0755 must also be recursively on all subfolders. 1 Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 28, 2022 Share Posted December 28, 2022 Read this thread and maybe it can help you: Link to comment Share on other sites More sharing options...
ps8modules Posted December 28, 2022 Share Posted December 28, 2022 (edited) Of course, you can also run your own script to change permissions for folders and subfolders in ./img/p/. Just insert this script into the root of the eshop and call it in the URL. For example, the file will be named img-permission.php So you run it, for example, https://my-shop.com/img-permission.php <?php include('./config/config.inc.php'); include('./init.php'); $files = false; /* change permission on all files in dir "Demanding on script runtime" */ $time_start = microtime(true); for($ii = 1; $ii <= 9; $ii++){ $path = _PS_PROD_IMG_DIR_.$ii; changeDirPermission($path, $files); for($jj = 0; $jj <= 9; $jj++) { $path = _PS_PROD_IMG_DIR_.$ii.'/'.$jj; changeDirPermission($path, $files); for($kk = 0; $kk <= 9; $kk++) { $path = _PS_PROD_IMG_DIR_.$ii.'/'.$jj.'/'.$kk; changeDirPermission($path, $files); for($ll = 0; $ll <= 9; $ll++) { $path = _PS_PROD_IMG_DIR_.$ii.'/'.$jj.'/'.$kk.'/'.$ll; changeDirPermission($path, $files); for($mm = 0; $mm <= 9; $mm++) { $path = _PS_PROD_IMG_DIR_.$ii.'/'.$jj.'/'.$kk.'/'.$ll.'/'.$mm; changeDirPermission($path, $files); for($nn = 0; $nn <= 9; $nn++) { $path = _PS_PROD_IMG_DIR_.$ii.'/'.$jj.'/'.$kk.'/'.$ll.'/'.$mm.'/'.$nn; changeDirPermission($path, $files); } } } } } } $time_end = microtime(true); $execution_time = ($time_end - $time_start); echo '<b>Total Execution Time:</b> '.round($execution_time, 2).' second'; function changeDirPermission($path, $files) /* It should not be longer than 60 seconds */ { if (file_exists($path)){ chmod($path, 0755); if ($files == true){ changeFilesPermission($path); } } } function changeFilesPermission($path) { if (file_exists($path)){ $files = scandir($path); if ($files){ foreach ($files as $file){ chmod($file, 0644); } } } } Edited December 28, 2022 by prestashopfree.com (see edit history) 1 Link to comment Share on other sites More sharing options...
knacky Posted December 29, 2022 Share Posted December 29, 2022 Hi. Thank you, it works perfectly. For me, it took 53 seconds to change the permissions of all folders and subfolders. Good work. Link to comment Share on other sites More sharing options...
TiaNex Shopping Posted January 7, 2023 Share Posted January 7, 2023 please make sure there is enough space on the disk Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now