easysoft / phpmicro

micro sfx SAPI for php
Apache License 2.0
255 stars 30 forks source link

Instructions on using PHAR bundles with phpmicro #3

Open ryangjchandler opened 2 years ago

ryangjchandler commented 2 years ago

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?

dixyes commented 2 years ago

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.

theofidry commented 1 year ago

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

dixyes commented 1 year ago

@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)

theofidry commented 1 year ago

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

jorbascrumps commented 9 months ago

@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.

dixyes commented 5 months ago

@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