title: unable to create PHAR archive
body: <p>im a PHP newbie . .</p>
  
  <p>i've tried to make a PHAR of my project.</p>
  
  <p>my project include 5 directories and multiply classes within each dir.</p>
  
  <p>I've followed this tutorial </p>
  
  <p><a href="http://www.script-tutorials.com/phar-php-archiving-practice/" rel="nofollow">Phar – PHP archiving practice</a></p>
  
  <p>and i did the following: </p>
  
  <p>to my main index.php i added this lines:</p>
  
  <pre><code>$sLibraryPath = 'lib/myPhar.phar';
  
  // we will build library in case if it not exist
  if (! file_exists($sLibraryPath)) {
     ini_set("phar.readonly", 0); // Could be done in php.ini
  
     $oPhar = new Phar($sLibraryPath); // creating new Phar
     $oPhar-&gt;setDefaultStub('index.php', 'classes/index.php'); // pointing main file which require all classes
     $oPhar-&gt;buildFromDirectory('classes/'); // creating our library using whole directory
  
     $oPhar-&gt;compress(Phar::GZ); // plus - compressing it into gzip
  </code></pre>
  
  <p>}</p>
  
  <p>and i created a new folder called classes , and created a index.php file within it, and there i included all my project classes.</p>
  
  <p>i've chmod 777 the following directories: lib, HelloWorld , HelloWorld/index.php  ,</p>
  
  <p>and changed the phar.readonly. (phar.readonly = 0)</p>
  
  <p>still i get this message:</p>
  
  <pre><code>Fatal error: Uncaught exception 'PharException' with message 'unable to create temporary file' in /Applications/XAMPP/xamppfiles/htdocs/HelloWorld/index.php:10 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/HelloWorld/index.php(10): Phar-&gt;setDefaultStub('index.php', 'classes/index.p...') #1 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/HelloWorld/index.php on line 10
  </code></pre>
  
  <p>i havent found any helpful info what to do with it, and i will glad for your help.</p>
  
  <p>(if there is a better way to create PHAR it will be fine)</p>