Hi,

While trying to upload images in text field on ckeditor and imce, I get the following PHP warnings:
1. Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(D:\InetPub\Temp\PHP\phpBE70.tmp) is not within the allowed path(s): (D:\InetPub\vhosts\example.com\d7\) in image_get_info() (line 126 of D:\InetPub\vhosts\example.com\d7\includes\image.inc).
2. Warning: getimagesize() [function.getimagesize]: open_basedir restriction in effect. File(D:\InetPub\Temp\PHP\phpBE70.tmp) is not within the allowed path(s): (D:\InetPub\vhosts\example.com\d7\) in image_gd_get_info() (line 349 of D:\InetPub\vhosts\example.com\d7\modules\system\image.gd.inc).
3. Warning: getimagesize(D:\InetPub\Temp\PHP\phpBE70.tmp) [function.getimagesize]: failed to open stream: Operation not permitted in image_gd_get_info() (line 349 of D:\InetPub\vhosts\example.com\d7\modules\system\image.gd.inc).

Folder permissions set correctly on directories under /sites ( as far as I can tell ).
I have no way of editing php.ini and I don't think the solution should be on this point.
It looks like the API used to upload the image, uses PHP upload settings and uses temp directory outside the site root.

The result is that the image is uploaded to the server but IMCE gui can't see the image preview, Can't see thumbnail and if image still inserted to the text field, it does not show when content is published.

Comments

ufku’s picture

Category: bug » support

You can change your temp directory under file system settings.

royep’s picture

Hi,

Temp directory already defined under the server root path /sites/default/files/tmp
In the upload process for some reason the code uses somewhere a temp directory other than the one set in this directive.

ufku’s picture

Set upload_tmp_dir in php.ini

royep’s picture

Hi,

As I wrote at the beginning that I don't have access to php.ini at most, only very basic and non relevant directives revealed to me via plesk control panel page.
Development of Drupal and it's modules should be with consideration of implementing on hosted solutions with minimal editing capabilities to the php.ini and server configurations.

However, in this case I can't understand why it won't act the way uploading simple file works.
a file field works with no errors.

Perhaps the issue here is that IMCE tries to pull metadata from the image while it's in it's temp location before copying it to it's final destination instead of reverse order of action.

Perhaps there's an alternative upload function that uses Drupal temp directory.

thalles’s picture

Hi @royep!
Has your problem been solved?

thalles’s picture

Status: Active » Fixed

Maybe you can setting this by web.config

or you can try this: https://support.plesk.com/hc/en-us/articles/360001540233-How-to-change-t...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.