Closed clwells closed 6 years ago
Hm this is very weird, I can't manage to reproduce it (I used the same link as you, thanks for giving it).
Could you provide more details on the:
php -i
?Yep, I figured :D. It's a CentOS 7 box. I will try on a few others as well.
🤔 I'm a bit lost tbh. It's one of the either:
Could it be that being in a chroot environments play a role there? Could you give it a shot outside of it?
It's not chroot'd - but it is an SCL version of PHP. Will dig into and PR something if I can sort out what's going on.
Closing for now as it doesn't really look related to Box. That being said, Box does provide some help to work around PHP & PHAR's limitations (e.g. to allow to compress a PHAR although without Box it would fail due to too many files open). So if you do find something that Box could help with, please report it :)
I had this on a created phar (as well as with the box.phar too) and after some trial and error i got my phar working with using the default stub instead of the box stub:
"stub": false
The system i got the error on was a docker container CentOS 7.4 .
I'm missing the requirements checker for now, but the phar is working flawlessly now.
🤔 this is really troubling.
Can you try:
You can try again to build the PHAR, so far it shouldn't fail since in the end, you are using the default stub but this one is coming from a file instead of a $phar->setDefaultStub()
.
Now, assuming the above works fine, can you try to add the requirement checker manually in the file like it is done in the custom Box stub and then check the result? This is to know if the issue comes from the custom stub itself or from the requirement checker which is included in the stub.
Sorry to be dependent on you for this, I cannot test under a CentOS machine :(
I'm getting the same error when adding:
include 'phar://'.__FILE__.'/.box/check_requirements.php';
in the default stub.
When including
include 'phar://'.__FILE__.'/.box/bin/check-requirements.php';
the checker is working as advertised.
The first file is just including the latter one, but without any phar:// prefix:
namespace KevinGH\Box\RequirementChecker;
require 'bin/check-requirements.php';
I'm new to creating phars myself, but as there is nothing else in that file i'd assume this could be the potential culprit.
Thanks, I'll look into it ASAP
Could you try again my replacing:
<?php
/*
* This file is part of the box project.
*
* (c) Kevin Herrera <kevin@herrera.io>
* Théo Fidry <theo.fidry@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace KevinGH\Box\RequirementChecker;
require 'bin/check-requirements.php';
By:
<?php
/*
* This file is part of the box project.
*
* (c) Kevin Herrera <kevin@herrera.io>
* Théo Fidry <theo.fidry@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace KevinGH\Box\RequirementChecker;
require __DIR__.'/bin/check-requirements.php';
// Or if the above doesn't work:
include 'phar://'.__FILE__.'/.box/bin/check-requirements.php';
In the PHAR? The offending file is box.phar/.box/check_requirements.php
In all fairness I'm wondering why there is .box/check_requirements.php
and then .box/bin/check_requirements.php
, maybe the former could be removed
I would think so too, just get rid of the "empty" file.
I'm sure I'm being dumb and have looked through all of the issues and I'm the only dumb one with this issue. Have tried a few versions back. I've got the cloned version of box working just fine - just trying to use the phar version.