|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-10-01 20:57 UTC] admin at sulehosting dot co dot za
Description: ------------ I am trying to create a phar file, following examples from the php.net http://us.php.net/manual/en/phar.using.object.php Reproduce code: --------------- <?php $phar = new Phar("/tmp/first.phar",0,"first.phar"); $phar['hello.txt'] = 'hello world'; ?> and <?php $phar = new Phar("/tmp/first.phar"); $phar['hello.txt'] = 'hello world'; ?> Expected result: ---------------- I expect a phar file to be created in the tmp directory, Actual result: -------------- UnexpectedValueException: creating archive "/tmp/first.phar" disabled by INI setting in /srv/www/htdocs/PHAR/test_phar.php on line 2 Call Stack: 0.0003 323772 1. {main}() /srv/www/htdocs/PHAR/test_phar.php:0 0.0003 328724 2. Phar->__construct() /srv/www/htdocs/PHAR/test_phar.php:2 php --ri Phar Phar Phar: PHP Archive support => enabled Phar EXT version => 2.0.0-dev Phar API version => 1.1.1 CVS revision => $Revision: 1.370.2.62 $ Phar-based phar archives => enabled Tar-based phar archives => enabled ZIP-based phar archives => enabled gzip compression => enabled bzip2 compression => enabled OpenSSL support => enabled Phar based on pear/PHP_Archive, original concept by Davey Shafik. Phar fully realized by Gregory Beaver and Marcus Boerger. Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle. Directive => Local Value => Master Value phar.readonly => On => On phar.require_hash => On => On phar.cache_list => no value => no value PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
1)file_put_contents (works!) $strFile = '/tmp/myFile.txt'; $strData = 'hello world'; $res = file_put_contents($strFile, $strData); if($res): print 'it works'; else: print 'it failed'; endif; 2)uname -a Linux pegasus 2.6.27.29-0.1-pae #1 SMP 2009-08-15 17:53:59 +0200 i686 i686 i386 GNU/LinuxAfter one year of reporting this bug, I got the same problem. I followed all comments but for me, the phar is not there!! $phar = new Phar('./test.phar', 0, 'test.phar'); $phar->startBuffering(); $phar['test.txt'] = 'phar is here'; $phar->setStub($phar->createDefaultStub('index-cli.php', 'index.php'));