|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-04-20 12:52 UTC] mike at ziebeck dot net
Description: ------------ Adding more than 2042 files results in Fatal error: Uncaught exception 'PharException' with message 'unable to create temporary file' According to http://devzone.zend.com/manual/ref.phar.html There should be a 4Byte "Number of files in the Phar" limit Running different test cases, i can see by now: * Adding files via transaction does not make a difference $p->startBuffering(); // add files here $p->stopBuffering(); * Mini stub does not make a difference $p->setStub('<? __HALT_COMPILER(); ? >'); // add files here * BZ2 compression does not make a difference $p->compress(Phar::BZ2); // add files here * Using subdirectories containing less than 2000 files each does not make a difference too. Stops on the exact file. * Changing that file (rename, content, removing) does not matter. It always stops on file: 2042 * TEMP and TMP Directory does not matter. phpXXXX.tmp files are created/updated/removed frequently in there and sufficient disk space is available. Script has been run via CLI using parameters: php -c php.ini-dist -d extension=php_phar.dll -d phar.readonly=0 -f TestPharFileLimit.php Using v5.2.6RC6-dev Snapshot release: ------------------------------------- http://snaps.php.net/win32/php5.2-win32-200804171230.zip http://snaps.php.net/win32/pecl5.2-win32-200804171230.zip Reproduce code: --------------- <? $pArchive="DataArchive.phar"; $dirName=str_replace(DIRECTORY_SEPARATOR, "/", dirname(__FILE__)); $p=new Phar("$dirName/$pArchive", 0, $pArchive); for($i=0; $i<16*1024; $i++){ echo("\rWriting File($i) "); if(!is_dir($fileDir="$dirName/test_data")) mkdir($fileDir, 0777, true); file_put_contents("$fileDir/$i", ""); $p->addFile("$fileDir/$i", "$dirName"); } echo("\r Written Files($i) \r\n"); ?> Expected result: ---------------- Written Files(16384) Actual result: -------------- Writing File(2042) Fatal error: Uncaught exception 'PharException' with message 'unable to create temporary file' in D:\Php\TestPharFileLim it.php:10 Stack trace: #0 D:\Php\TestPharFileLimit.php(10): Phar->addFile('D:/Php/test_dat...', 'D:/Php') #1 {main} thrown in D:\Php\TestPharFileLimit.php on line 10 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 08:00:02 2025 UTC |
Well done. I've verified this issue again ... Using win32 snapshot version of PHP 5.2: [Problem fixed] -------------------------------------------------------- php5.2-win32-200804280030.zip pecl5.2-win32-200804280030.zip Using win32 snapshot version of PHP 5.3: [Problem persists] ----------------------------------------------------------- php5.3-win32-200804251230.zip pecl5.3-win32-200804251230.zip * 2042 file limit persists * unlinking the temporary file (see new script) results in: Warning: Permission denied Not tested: win32 snapshot version of PHP 6.0: [no PECL] -------------------------------------------------------- Reproduce code: --------------- <? $pArchive="DataArchive.phar"; $dirName=str_replace(DIRECTORY_SEPARATOR, "/", dirname(__FILE__)); $p=new Phar("$dirName/$pArchive", 0, $pArchive); for($i=0; $i<16*1024; $i++){ echo("\r writing File($i) "); if(!is_dir($fileDir="$dirName/test_data")) mkdir($fileDir, 0777, true); file_put_contents($tmpFile="$fileDir/$i", ""); $p->addFile($tmpFile, $i); //unlink($tmpFile); } echo("\r Written Files($i) \r\n"); ?>