|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2002-02-28 20:07 UTC] vedad at kajtaz dot net
 Hello, I've got a weird open_basedir restriction error on copy() of an uploaded file. This occurs with php4.1.2, after upgrading from the old 4.0.4pl1, which didn't have the problem. php.ini and apache configuration were unchanged. Virtual host settings: php_admin_value open_basedir /path/to/website/ php_admin_value upload_tmp_dir /path/to/website/temp I'm now getting an error when file is being copied from /path/to/website/temp/<phptempfile> to /path/to/website/somewhereelse/ Error label: Warning: open_basedir restriction in effect. File is in wrong directory in /path/to/website/somescript.phtml on line 1055 As copy-source, copy-destination and tmp folder are all within open_basedir, I really don't get the problem. Am I missing something? Please note that in my case, /path/to/website is a symbolic link to /mnt/mountpoint/to/website, but i had no more success by putting the "real" path into open_basedir section. Thanx, -- vedad PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 22:00:01 2025 UTC | 
PHP version 4.3.10 Using various file operations on a file that does not exist will produce an open_basedir restriction violation. Example 1: set open_basedir to "/home/ryan/public_html" script 1: stat('/home/ryan/public_html/a'); // a is a non-existant file output: Warning: stat(): open_basedir restriction in effect. File(/home/ryan/public_html/a) is not within the allowed path(s): (/home/ryan/public_html) in /home/ryan/public_html/a.php on line 3 Example 2: set open_basedir to "/home/ryan/public_html:/tmp" script 2: echo stat('/home/ryan/public_html/images/articles/'); // this is successful copy('/tmp/phpTqhjMx','/home/ryan/public_html/images/articles/new.jpg'); // /tmp/phpTqhjMx exists, new.jpg does not output: Array Warning: copy(): open_basedir restriction in effect. File(/home/ryan/public_html/images/articles/new.jpg) is not within the allowed path(s): (/home/ryan/public_html:/tmp) in /home/ryan/public_html/test.php on line 4