Questions tagged [phar]

Phar is the PHP Archive format. It is analogous to Java's JAR files.

Phar is the PHP Archive format.

A Phar file consists of a collection of PHP scripts combined into a single compressed file, for easy distribution and installation.

More information can be found here.

310 questions
9
votes
1 answer

Php5-FPM error while including multiple phar files

We are using a Ubuntu+nginx+php5-fpm combination on our servers with PHP version being 5.5. We are trying to run index.php which includes a bunch of phar files. Something like: When this script is…
Shreeni
  • 3,092
  • 7
  • 24
  • 39
9
votes
6 answers

PHP Phar - file_exists() issue

My Phar script creates a new file with fwrite, which works fine, it creates the new file outside the phar, in the same directory as the phar file. But then when i use if(file_exists('file.php')) it doesn't pick it up. But then include and require do…
Lan
  • 1,668
  • 2
  • 18
  • 34
8
votes
2 answers

Determine if PHP files is Running as Part of a `phar` archive

Is there a way to determine, at runtime, if a PHP file is running as part of a phar archive? i.e., a native implementation might look something like this function isRunningAsPhar() { $first_include = get_included_files()[0]; return…
Alan Storm
  • 157,413
  • 86
  • 367
  • 554
8
votes
2 answers

PHAR internal corruption (crc32 mismatch) during process fork

I am developer of ko-worker library. I add feature with phar executable as daemons application. And found strange behavior with phar and process forking undex linux. Each time the master process fork`s more then 1 child i got error like that…
misterion
  • 5,683
  • 3
  • 32
  • 55
8
votes
5 answers

why aws.phar runs once then won't load again?

I install aws sdk for php in my elastic beanstalk application using phar file,: require_once __DIR__ . '/../AWS-SDK/aws.phar'; when I run the script for the first time, it succeed ! but when I try again I got this error : Warning:…
david
  • 2,960
  • 4
  • 32
  • 54
8
votes
2 answers

how to get a .phar file real directory within the phar file code?

I am trying to create a php executable (a phar file) for generating some files, and I would like to know how to get the real path of the phar file (within the phar file code). What I want to do is to create a folder in the same level of the phar…
itsjavi
  • 2,467
  • 1
  • 19
  • 24
8
votes
3 answers

Installing Laravel 4.1 in Windows 7 // Make .phar file globally available to windows command line

i have some problems installing Laravel 4.1 in Windows 7 via the first method explained in the Laravel documentation ( http://laravel.com/docs/installation#install-laravel ). So I downloaded the laravel.phar file and put it in my path ( System32 ).…
Jakob Fuchs
  • 356
  • 2
  • 3
  • 12
8
votes
7 answers

Using Composer PHP on Shared Space

I'm using Bluehost and do have access to SSH, thankfully. I've also set my PHP to 5.4 in the Control Panel settings. Now, here's the two big questions that I can't seem to grasp: how do I install Composer and furthermore, after installing Composer,…
Ally
  • 1,882
  • 1
  • 13
  • 20
8
votes
1 answer

How to make an executable phar?

I want to start a phar script as an executable, directly by doing foo.phar instead of php foo.phar .
magnetik
  • 4,122
  • 37
  • 56
7
votes
2 answers

Unexpected problems with PHP PHAR

After a little testing/scripting/playing with PHP 5.3 PHAR archives, I discovered some problems. glob PHAR doesn't work with glob. Neither as wrapper (http://www.php.net/manual/en/phar.using.stream.php#104320) nor as a function call. In my test…
mheinzerling
  • 875
  • 1
  • 8
  • 30
7
votes
2 answers

Encryption with PHP Phar

Is it possible to encrypt/password-protect a Phar archive to enable closed-source software distribution?
MidnightLightning
  • 5,964
  • 5
  • 37
  • 66
7
votes
1 answer

Static content inside phar archive

I was just wondering if it is legal to add static content to phar archives (images, javascript or html files). And if so, how do I get them out to serve to a client? The only example I've seen so far was:
facha
  • 10,420
  • 13
  • 54
  • 76
7
votes
3 answers

How to run composer update on PHP server?

Is there a way to run composer update command on our production/test environment? Problem is that i don't have access for Command Line.
WhipsterCZ
  • 618
  • 8
  • 13
7
votes
1 answer

How to get current working directory inside Phar?

How can I getcwd() in a PHP script in a Phar archive when called from the console? Consider this call: /path/to/my/actual/cwd> php index.php In this case, getcwd() will return /path/to/my/actual/cwd. Now we take the same script, put it in a Phar…
Tony Bogdanov
  • 6,238
  • 10
  • 45
  • 74
7
votes
1 answer

How to get phar archive meta-data inside of executed phar?

I have packaged PHP application into executable Phar archive and have there inside one Class with method which should access executed Phar archive meta-data. I could get meta-data as shown below however that seems odd that I load same Phar inside…
mkungla
  • 2,884
  • 1
  • 21
  • 34
1
2
3
20 21