phpmicro icon indicating copy to clipboard operation
phpmicro copied to clipboard

Instructions on using PHAR bundles with phpmicro

Open ryangjchandler opened this issue 3 years ago • 6 comments

Hey, looking to use this alongside a PHAR bundle produced with the Box library. I downloaded the latest build from the workflow artifacts.

Upon concatenating the 2 files together, PHP reports that the PHAR is corrupted.

Am I missing a crucial step, or does phpmicro not have PHAR support out of the box?

ryangjchandler avatar Jun 16 '22 14:06 ryangjchandler

The workflow version does not support any compression, try https://github.com/dixyes/lwmbs/actions/runs/2507973225 (linux) or https://github.com/dixyes/lwmbs/actions/runs/2507973226 (mac)

If they donot work, maybe it's a bug, please provide step to reproduce, and let me try to fix it.

dixyes avatar Jun 16 '22 14:06 dixyes

For the record I would be very interested in being able to make it work with PHARs: https://github.com/box-project/box/issues/331

theofidry avatar Jan 18 '23 22:01 theofidry

@theofidry

micro do support phar (this issue is due to compression and a missing phar patch which make sfx built in project workflow donot support it)

For laravel, laravel hardcoded many tests against sapi name to match "cli", micro may not work because of this.

To workaround this, micro can make itself pretend to be "cli"

lwmbs have a workflow for this usage:

https://github.com/dixyes/lwmbs/actions/runs/3945754818

(choose "micro-cli" versions of micro sfx, it have fake sapi name of "cli" and added many phar compression supports)

dixyes avatar Jan 19 '23 02:01 dixyes

Oh cool, ok I will have to give it another go then!

theofidry avatar Jan 19 '23 20:01 theofidry

@ryangjchandler Did you ever sort this out? I'm currently getting internal corruption of phar "app.phar" (truncated manifest header). I'm also using Box (via laravel-zero) and then cat micro.sfx app > app.phar.

I've tried disabling Box's compression as well as the builds provided by @dixyes but the links are broken/ expired now.

jorbascrumps avatar Feb 02 '24 00:02 jorbascrumps

@ryangjchandler Did you ever sort this out? I'm currently getting internal corruption of phar "app.phar" (truncated manifest header). I'm also using Box (via laravel-zero) and then cat micro.sfx app > app.phar.

I've tried disabling Box's compression as well as the builds provided by @dixyes but the links are broken/ expired now.

You may get a binary from lwmbs workflow runs https://github.com/dixyes/lwmbs/actions/ (select any latest workflow run for you OS, then choose variants with name "micro-cli") or static-php https://github.com/crazywhalecc/static-php-cli

My Github notification broken for months, sorry for late reply

dixyes avatar May 29 '24 09:05 dixyes