Php compaction tool, that allow you to make a .phar of your php project and Library.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jérémi N ‘EndMove’ 1f2481cd26
Update tool link
8 months ago
src initial commit 8 months ago
.gitignore initial commit 8 months ago
LICENSE initial commit 8 months ago update readme 8 months ago
phar-creator.php Update tool link 8 months ago
win-build.cmd initial commit 8 months ago


Donate Website


Phar-Creator is a PHP compaction tool that allows you to compress your project, library, etc. into a .phar archive, so that you have a single file containing them all. You can freely add an entry point in case your program is made to be executed directly by client, a web entry point, or meta data and more. The compaction tool will also provide you with a Sha256 fingerprint of the resulting .phar.


You will find below the two modes of use of the tool, the first by using the provided windows executable win-build.cmd or the CLI (terminal). The second one by accessing directly the script via internet (WEB).

For these two modes of use you will have to configure the script in the section CONSTANTS to config. This repository is already a complete example of phar-creator use. Our example is called hello-world it has been made to be as understandable as possible I invite you to browse it to discover the structure (people used to it can abstain).

CLI packaging


  • PHP version >= 7.4 ;
  • PHP must be CLI ready (win: add to environement variable, linux: installed) ;

Examples by method

  1. Run the script directly into your terminal php -dphar.readonly=0 phar-creator.php.
  2. Run the win-build.cmd script.

WEB packaging


  • PHP version >= 7.4 ;
  • The web server must have read and write permissions or run as administrator ;
  • In the php.ini, phar.readonly must be disabled, so set to false ;

Example web

  • Simply navigate to the access url of the script http://your-website.domain/phar-creator.php.

Project structure (example)

│   phar-creator.php        ==> The main tool to place in project's root directory.
│   win-build.cmd           ==> The windows script to start the tool.
├───build                   ==> The build directory.
│       hello-world.phar
└───src                     ==> The source code directory.
    │   main.php            ==> The hello-world (example) entrypoint.
    │       personFactory.php
    │       Person.php