Posted on February - 21 - 2010
Prestashop: Upload errors fixes (open_basedir and upload_tmp_dir problems demystified)
I have experienced still some errors on image uploading in prestashop that relates to server settings. So only fixing prestashop image library will not suffice to enabling image uploading if we have problems in server settings.
At first check the fixed image library from this article:
Prestashop Image Upload Errors Fixes
If it doesn’t work, you need to check whether temporary folder used for file uploading is set and if it’s accessible by your php script. A very common problem is it is set but out of your permitted home directory. In that case if open_basedir restriction is set, you won’t be able to read the file in your temporary folder. This is a prestashop bug because they tries to read it rather than checking if it’s uploaded in php’s recommended way!
You may see this type of errors if warning display is on in your server:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/tmp/phpMyjhN6) is not within the allowed path(s): (/home/e-smith/files/ibays/Primary/) in /home/e-smith/files/ibays/Primary/html/shop/admin534/tabs/AdminProducts.php on line 603
Solution:
1. Check if upload_tmp_dir has a value in your php configuration. If it’s not set, ask your host to set it. Then check if image uploading works. Otherwise proceed to step 2
2. Check if upload_tmp_dir is in your home path. If you cannot do it, or if it is not, ask your host to move the tmp folder to your home directory.
3. If you can no way solve this issue, you can hire me. It will need to change a lot of prestashop scripts.









































