|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-06-20 08:50 UTC] elettrico at diciannove dot net
[2008-06-20 08:53 UTC] pajoye@php.net
[2008-06-28 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 14:00:01 2025 UTC |
Description: ------------ I'm setting up a virtualhost with this configuration: php_admin_value open_basedir "/home/data/web/tdo:/home/data/tdo/tmp:/home/sys/apache2/errorpages/:/usr/lib/php/:/tmp" php_admin_value doc_root "/home/data/web/tdo/" php_admin_value include_path "/home/data/web/tdo/:/home/sys/apache2/errorpages/:/usr/lib/php/" php_admin_value session.save_path "/home/data/tdo/sess/" php_admin_value upload_tmp_dir "/home/data/tdo/tmp/" a simple page that try to do a fopen and after a fwrite fail to execute, after investigating a little I'll see that it's the tempnam() function that fail, after fail the fopen, also without issuing any error, and finally the fwrite, that fire ad error: Warning: fwrite(): supplied argument is not a valid stream resource in /home/data/web/tdo/test.php on line 7 Warning: fclose(): supplied argument is not a valid stream resource in /home/data/web/tdo/test.php on line 8 I don't see any problem in my configuration nor in my code, my php version is the version of the debian package: PHP 5.2.0-8+etch11 (cli) (built: May 10 2008 10:35:46) Reproduce code: --------------- $tmpfname = tempnam("", ""); //it's the same with $tmpfname = tempnam("*", ""); $handle = fopen($tmpfname, "w"); fwrite($handle, "writing to tempfile"); fclose($handle); Expected result: ---------------- A file opened in the system TMPDIR (/tmp) or an error.