This is a bit of a weird one, so please bear with me.
I'm trying to get Bugsnag up and running on our custom platform.
The boilerplate code looks like:
if ( !include_once($NP->settings->paths->external .'/Bugsnag/guzzle.phar') )
exit('Failed to load ERROR: guzzle');
if ( !include_once($NP->settings->paths->external .'/Bugsnag/bugsnag.phar') )
exit('Failed to load ERROR SYSTEM: bugsnag');
This unfortunately throws an exception:
Fatal error: require(): Failed opening required 'phar://guzzle.phar/autoloader.php'
However, if I attempt to load this outside of our platform, it seems to spin up just fine.
As I am not thoroughly familiar with the ins and outs of working with phar's, what could we be setting which would interfere with a phar's ability to reference inside it's own container?
Information:
Ubuntu 16.04.2 LTS
PHP 7.0.18-0ubuntu0.16.04.1 (Phar is native)
Phar EXT version: 2.0.2
Phar API version: 1.1.1
Phar-based phar archives: enabled
Tar-based phar archives: enabled
ZIP-based phar archives: enabled
gzip compression: enabled
bzip2 compression: disabled
Native OpenSSL support: enabled
phar.readonly: On
phar.require_hash: Off
Any assistance will be appreciated.
Thanks!
UPDATE: After doing some testing with a colleague, I noticed that even putting the boilerplate code at the very top of our primary platform boot script, still threw the error. The only thing we could think of which changes in that case is a directory change (as the boot script is in the include_path
). After adding the external
directory to php's include_path
, it seemed to work. I am confused by this however, because it is my understanding that Phar files are self-contained to specifically not have issues like this. Why would a Phar file suddenly be unable to reference itself, after it has already be successfully included?
UPDATE: So, the above update is not an actual fix. The results are very strange. It will spin up fine one time, then fail the next few times. Again, this is when there is no other code loading before it. Something interesting: If we restart Apache, it loads on the first page load. Everything after that it fails.