Jump to content

[SOLVED] Upload images and modules backups won't work : No temporary folder was configured in php.ini.


Mag-WebDesign

Recommended Posts

Hi everyone,
we are facing an issue with uploads of images in BO Prestashop 1.7.4.0, also in saving work in some modules that uses uploads of images.
We have a dedicate server running with CentOS Linux release 7.6.1810 (Core), cPanel and also cloudflare.

Here is the error message we have on uploading images in products edition : No temporary folder was configured in php.ini.
The error message find in NewsletterPro when trying to save a model : Ajax request error, please check your console for more details!
The error message found in CreativeSlider for an image upload or an update of a slide : ERROR (instead of Saved at the bottom left of the page).

We found a lot of topics like this, and tried every solutions in there, neither of these worked for us, like :

1-> source :

--> solutions :
     - Check the write permissions for the folder / img / tmp. Permissions should be 0755.
   - Check the php configuration on the server + add at the end of the configuration "ini_set('session.save_path', '/tmp')".

==========
2-> source :

--> solutions :  Due to a PHP update, the upload_tmp_dir directory in php.ini has been set to /tmp .
    Simply replace it with the temporary folder created for this purpose. This can be linked to SELinux.
    PHP.INI : upload_tmp_dir = /var/zpanel/temp/

==========
3-> source :

--> solutions (come back to the first topic) : Find session.save_path or open_basedir in phpinfo.php. There we should find the path to our /tmp folder.
   - The path should look like this (in php.ini) :
     ; where MODE is the octal representation of the mode. Note that this
     ; does not overwrite the process's umask.
     session.save_path = /home/users/web/b1447/ipg.teamshepherdusa/cgi-bin/tmp
   - or if there is no /tmp folder in the presta root, create one.


My apologize for the long topic.
We are blocked for 3 weeks now on this, and still no clues showing up. We tried to reach other bug reports from everywhere.
So if anyone had experienced this and has found another solution than the ones above, we would be very grateful if you share it !

Hope to hear from one of you soon,
Best Regards,
Mag

Link to comment
Share on other sites

Hello EvaF, thanks for your answer.

My friend Axel_WATS respond, but moderation hasn't validate his answer yet, here it is :

Quote

 

Hello EvaF, thanks for your answer.

I work with Mag on this issue, the permissions are all 755.

Nothing relevant in the logs.

Any other ideas ?

 

He also tried to change Php Version on the server :

The server is on PHP 7.0, he tried to upgrade to PHP 7.1 but it has broken the website, so get back to PHP 7.0.
 

Link to comment
Share on other sites

check the following:

1) check if SELinux is disabled - unless you take care of all affected directories
2) check uid, gid of your webserver ( apache, nginx ) versus uid, gid of your prestashop file permissions
3) check error log of your webserver
4) check the following php settings open_basedir, upload_tmp_dir
 

Here are the most efficient  steps to find  the problem from the Linux command line:
a) find the pid of active webserver thead
b)  use the following command to display file system I/O errors:
 

strace -e file -f -p [pid]

 

Link to comment
Share on other sites

We found the solution to our problem, here's what we've done for the next people who come through here:

Just changing permissions wasn't enough.
As on many topics related to this problem, it was necessary to change the "session.save_path=/home/YourSite/public_html/tmp" and the "upload_tmp_dir=/home/YourSite/public_html/tmp" in php.ini on the server.
What we had done BUT not on the CPanel, which has its own php.ini (which I didn't know) and the server's one with the same configuration.
So I added the two lines above in the CPanel's php.ini (for php7.0), gave the 755 permissions to the "tmp" folder, and the problem is solved.

Thanks EvaF for the help !

Link to comment
Share on other sites

  • Mag-WebDesign changed the title to [SOLVED] Upload images and modules backups won't work : No temporary folder was configured in php.ini.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...