cpuin Posted July 16 Share Posted July 16 Hi, Before posting here I have read several topics, but they were for other versions of Prestashop and non of them have solved my problem. I'm using Prestashop 1.7.6.5 and since few days I'm unable to upload product images.I got this error 500 (see the attachment). I have contacted the support of my hosting and they also have tried everything and have assured me that they haven't made any changes. What I have tried is: - regenerate .htaccess disabling Frindly URL and enable them again. - didn't work - clear all caches incl. smarty - didn't work What from the hosting told me is that Prestashop can't find /tmp temporary folder to write or something like this. Many thanks in advance to all of you! Link to comment Share on other sites More sharing options...
Knowband Plugins Posted July 16 Share Posted July 16 Hi, Please enable the debug mode and then share the error that occurs while uploading an image from the network panel. If the error is related to the temp file Not Found, Please try adding the following code snippet: file_put_contents($_FILES['image_product']['tmp_name'], Tools::file_get_contents($_FILES['image_product']['tmp_name'])); Insert this code into the addProductImage() function located in: /controllers/admin/AdminProductsController.php For reference, please see the screenshot below:https://prnt.sc/jgSP0VDfPzEO After this, clear the cache and then try uploading the image again. If the issue still persists, then please share screenshot of the error. Link to comment Share on other sites More sharing options...
cpuin Posted July 16 Author Share Posted July 16 I have added the line you have recommended in the beginning of the function you suggested. Have cleared the cache and tried , but got the same error SERVER 500 like the screenshot I have attached initially. When trying to switch to debug mode I got this error(see attachment) and rarely this file doesn't exist. Link to comment Share on other sites More sharing options...
Prestashop Addict Posted July 17 Share Posted July 17 Oups, for performances issues it is not recommended to set the cache in mySQL 😞 You should prefer files. Link to comment Share on other sites More sharing options...
cpuin Posted July 17 Author Share Posted July 17 15 minutes ago, Prestashop Addict said: Oups, for performances issues it is not recommended to set the cache in mySQL 😞 You should prefer files. I just have changed it to files. Anyway it didn't fix the problem. Link to comment Share on other sites More sharing options...
cpuin Posted July 22 Author Share Posted July 22 Doesn't anybody can help on this issue? I have tried whatever... Link to comment Share on other sites More sharing options...
Prestashop Addict Posted July 23 Share Posted July 23 Can you set debug mode on and see error message in xhr network tab in browser dev tools Link to comment Share on other sites More sharing options...
Totti Posted July 23 Share Posted July 23 Reset module prestashop BUS. 2 Link to comment Share on other sites More sharing options...
cpuin Posted July 24 Author Share Posted July 24 23 hours ago, Totti said: Reset module prestashop BUS. Many, Many thanks, updating this module has fixed the problem. 1 Link to comment Share on other sites More sharing options...
Totti Posted July 24 Share Posted July 24 5 minuti fa, cpuin dice: Many, Many thanks, updating this module has fixed the problem. I'm glad I could help you! Link to comment Share on other sites More sharing options...
abbrio Posted September 20 Share Posted September 20 The issue might be related to incorrect folder permissions or missing the /tmp directory. Try the following steps: Check Folder Permissions: Ensure that the /img and /tmp directories have the correct permissions (usually 755 or 775). Create /tmp Folder: Verify that the /tmp directory exists and is writable by the server. If it doesn’t exist, create it. PHP Configuration: Ensure that the server's PHP configuration points to the correct temporary directory. These steps should help resolve the image upload issue in Prestashop.null😇 Link to comment Share on other sites More sharing options...
Cedric38 Posted October 4 Share Posted October 4 On 7/24/2024 at 11:04 AM, cpuin said: Many, Many thanks, updating this module has fixed the problem. Dear All I'm face the same issue . Could you explain me more what is module prestashop BUS . I can not find int in my prestashop in french. regards Cédric Link to comment Share on other sites More sharing options...
Cedric38 Posted October 4 Share Posted October 4 On 9/20/2024 at 6:52 AM, abbrio said: The issue might be related to incorrect folder permissions or missing the /tmp directory. Try the following steps: Check Folder Permissions: Ensure that the /img and /tmp directories have the correct permissions (usually 755 or 775). Create /tmp Folder: Verify that the /tmp directory exists and is writable by the server. If it doesn’t exist, create it. PHP Configuration: Ensure that the server's PHP configuration points to the correct temporary directory. These steps should help resolve the image upload issue in Prestashop.null😇 Dear Abrrio I try your upper proposal. regard the 2 first is OK regarding the latest one (PHP configuration) could you explain me how I can check this step? regards Cédric 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