On 06/08/2011 01:07 AM, Peter Viskup wrote:
Hello all, I am running Drupal6 running on Debian Lenny with Apache2, PHP5 (suPHP+suhoshin patch) and mod_security2. I have issues with file upload I am getting error message: "warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/tmp/php6sDem4) is not within the allowed path(s): (/data/internal/drupal6:/data/www.example.com/www/drupal:/data/www.example.com/tmp/drupal) in /data/internal/drupal6/includes/image.inc on line 117."
All settings looks fine:
Apache vhost mod_security2 upload dir config: SecUploadDir /data/internal/drupal6/sites/www.example.com/files/tmp
php.ini config: upload_tmp_dir = /data/www.example.com/tmp/drupal open_basedir = /data/internal/drupal6:/data/www.example.com/www/drupal:/data/www.example.com/tmp/drupal include_path = ".:/usr/share/php5:/data/internal/drupal6:/data/www.example.com/www/drupal:/data/www.example.com/tmp/drupal"
Code <?php print file_directory_temp();?> is returning path sites/example.com/files/tmp path sites/www.example.com is symbolic link to sites/example.com.
Similar setup on Drupal5 is working fine. Any opinion why it is uploading files to /tmp directory?
-- Peter Viskup
It was just filesystem permission issue. The SecUploadDir directory must be writable by Apache user. Just overlooked that and after fixing this the uploads were using the directory specified in Apache vhost config file.
-- Peter Viskup