Replies: 7 comments 10 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Hmm think so I imagine something like: /usr/bin/microservice1 (First microservice binary) so to distribute/move microservice1 to another host, I would simply copy /usr/lib/libphp.so and /usr/bin/microservice1 (and maybe some PHP extension .so files as well) but the point is that the PHP interpreter (libphp.so) would only be on each host once Contrast this to: The latter would take up way too much space because each microservice would have it's own libphp.so statically linked in ? |
Beta Was this translation helpful? Give feedback.
-
It's possible to build embed SAPI (libphp.so) directly using static-php-cli, just replace But I haven't tested with dynamic linking with libphp.so compiled by static-php-cli and only tested on macOS. I will make these (sapi building args) as dynamic env variables (e.g. |
Beta Was this translation helpful? Give feedback.
-
Sure I can find some time tomorrow to test it - Just let me know ! |
Beta Was this translation helpful? Give feedback.
-
# rm -rf vendor
# rm -rf composer.lock
# wget https://github.com/captainhookphp/captainhook/releases/download/5.23.0/captainhook.phar
--2024-05-30 14:59:27-- https://github.com/captainhookphp/captainhook/releases/download/5.23.0/captainhook.phar
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/64998184/1f0a6c72-307d-47a3-a248-ed18fa54cd71?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240530%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240530T125932Z&X-Amz-Expires=300&X-Amz-Signature=348aed431fbad79020d99aba9c04d72eb15e91d12eaee512593e6ebd1823293a&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=64998184&response-content-disposition=attachment%3B%20filename%3Dcaptainhook.phar&response-content-type=application%2Foctet-stream [following]
--2024-05-30 14:59:27-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/64998184/1f0a6c72-307d-47a3-a248-ed18fa54cd71?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240530%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240530T125932Z&X-Amz-Expires=300&X-Amz-Signature=348aed431fbad79020d99aba9c04d72eb15e91d12eaee512593e6ebd1823293a&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=64998184&response-content-disposition=attachment%3B%20filename%3Dcaptainhook.phar&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.109.133, 185.199.108.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2221547 (2.1M) [application/octet-stream]
Saving to: ‘captainhook.phar’
# composer install --no-interaction --no-autoloader --no-scripts --profile
[14.6MiB/0.06s] Installing dependencies from lock file (including require-dev)
[15.1MiB/0.06s] Verifying lock file contents can be installed on current platform.
[17.5MiB/0.14s] Package operations: 106 installs, 0 updates, 0 removals
[17.5MiB/0.28s] As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
[17.5MiB/0.28s] This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
[17.5MiB/0.28s] Installing 'unzip' or '7z' (21.01+) may remediate them.
[18.8MiB/0.32s] - Installing revolt/event-loop (v1.0.6): Extracting archive
[18.9MiB/0.33s] - Installing amphp/serialization (v1.0.0): Extracting archive
[18.9MiB/0.33s] - Installing amphp/amp (v3.0.2): Extracting archive
[19.0MiB/0.33s] - Installing amphp/pipeline (v1.2.0): Extracting archive
[19.0MiB/0.34s] - Installing amphp/sync (v2.2.0): Extracting archive
[19.1MiB/0.34s] - Installing amphp/cache (v2.0.1): Extracting archive
[19.1MiB/0.34s] - Installing amphp/parser (v1.1.1): Extracting archive
[19.1MiB/0.35s] - Installing psr/http-message (2.0): Extracting archive
[19.2MiB/0.35s] - Installing psr/http-factory (1.1.0): Extracting archive
[19.2MiB/0.35s] - Installing league/uri-interfaces (7.4.1): Extracting archive
[19.3MiB/0.36s] - Installing league/uri (7.4.1): Extracting archive
[19.3MiB/0.36s] - Installing kelunik/certificate (v1.1.3): Extracting archive
[19.3MiB/0.36s] - Installing symfony/polyfill-ctype (v1.29.0): Extracting archive
[19.3MiB/0.36s] - Installing daverandom/libdns (v2.1.0): Extracting archive
[19.4MiB/0.37s] - Installing amphp/byte-stream (v2.1.1): Extracting archive
[19.4MiB/0.37s] - Installing amphp/process (v2.0.3): Extracting archive
[19.4MiB/0.37s] - Installing amphp/windows-registry (v1.0.1): Extracting archive
[19.5MiB/0.38s] - Installing amphp/dns (v2.1.2): Extracting archive
[19.5MiB/0.38s] - Installing amphp/socket (v2.3.1): Extracting archive
[19.5MiB/0.38s] - Installing composer/pcre (3.1.4): Extracting archive
[19.6MiB/0.38s] - Installing symfony/deprecation-contracts (v3.5.0): Extracting archive
[19.6MiB/0.38s] - Installing psr/container (2.0.2): Extracting archive
[19.6MiB/0.39s] - Installing symfony/service-contracts (v3.5.0): Extracting archive
[19.6MiB/0.39s] - Installing symfony/stopwatch (v7.0.7): Extracting archive
[19.7MiB/0.39s] - Installing symfony/process (v7.0.7): Extracting archive
[19.7MiB/0.39s] - Installing webmozart/assert (1.11.0): Extracting archive
[19.7MiB/0.39s] - Installing thecodingmachine/safe (v2.5.0): Extracting archive
[19.8MiB/0.41s] - Installing symfony/polyfill-mbstring (v1.29.0): Extracting archive
[19.8MiB/0.41s] - Installing symfony/var-dumper (v7.0.7): Extracting archive
[19.8MiB/0.42s] - Installing symfony/polyfill-iconv (v1.29.0): Extracting archive
[19.9MiB/0.43s] - Installing symfony/finder (v7.0.7): Extracting archive
[19.9MiB/0.43s] - Installing seld/phar-utils (1.2.1): Extracting archive
[19.9MiB/0.43s] - Installing seld/jsonlint (1.10.2): Extracting archive
[20.0MiB/0.43s] - Installing sebastian/diff (5.1.1): Extracting archive
[20.0MiB/0.43s] - Installing psr/log (3.0.0): Extracting archive
[20.0MiB/0.44s] - Installing phpstan/phpdoc-parser (1.29.0): Extracting archive
[20.0MiB/0.44s] - Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
[20.1MiB/0.45s] - Installing doctrine/deprecations (1.1.3): Extracting archive
[20.1MiB/0.45s] - Installing phpdocumentor/type-resolver (1.8.2): Extracting archive
[20.1MiB/0.45s] - Installing phpdocumentor/reflection-docblock (5.4.1): Extracting archive
[20.2MiB/0.46s] - Installing nikic/iter (v2.4.0): Extracting archive
[20.2MiB/0.46s] - Installing justinrainbow/json-schema (v5.2.13): Extracting archive
[20.2MiB/0.47s] - Installing symfony/filesystem (v7.0.7): Extracting archive
[20.3MiB/0.47s] - Installing symfony/polyfill-intl-normalizer (v1.29.0): Extracting archive
[20.3MiB/0.47s] - Installing symfony/polyfill-intl-grapheme (v1.29.0): Extracting archive
[20.3MiB/0.47s] - Installing symfony/string (v7.0.7): Extracting archive
[20.3MiB/0.48s] - Installing symfony/console (v6.4.7): Extracting archive
[20.4MiB/0.49s] - Installing nikic/php-parser (v4.19.1): Extracting archive
[20.4MiB/0.51s] - Installing jetbrains/phpstorm-stubs (v2022.3): Extracting archive
[20.4MiB/0.59s] - Installing fidry/filesystem (1.2.1): Extracting archive
[20.5MiB/0.59s] - Installing psr/event-dispatcher (1.0.0): Extracting archive
[20.5MiB/0.59s] - Installing symfony/event-dispatcher-contracts (v3.5.0): Extracting archive
[20.5MiB/0.59s] - Installing fidry/console (0.6.10): Extracting archive
[20.6MiB/0.60s] - Installing humbug/php-scoper (0.18.11): Extracting archive
[20.6MiB/0.61s] - Installing composer/xdebug-handler (3.0.5): Extracting archive
[20.6MiB/0.61s] - Installing composer/semver (3.4.0): Extracting archive
[20.6MiB/0.61s] - Installing amphp/parallel (v2.2.9): Extracting archive
[20.7MiB/0.62s] - Installing humbug/box (4.6.2): Extracting archive
[20.7MiB/0.75s] - Installing symfony/options-resolver (v7.0.7): Extracting archive
[20.7MiB/0.75s] - Installing symfony/event-dispatcher (v7.0.7): Extracting archive
[20.8MiB/0.75s] - Installing react/event-loop (v1.5.0): Extracting archive
[20.8MiB/0.76s] - Installing evenement/evenement (v3.0.2): Extracting archive
[20.8MiB/0.76s] - Installing react/stream (v1.3.0): Extracting archive
[20.9MiB/0.76s] - Installing react/promise (v3.2.0): Extracting archive
[20.9MiB/0.76s] - Installing react/cache (v1.2.0): Extracting archive
[20.9MiB/0.77s] - Installing react/dns (v1.12.0): Extracting archive
[21.0MiB/0.77s] - Installing react/socket (v1.15.0): Extracting archive
[21.0MiB/0.77s] - Installing react/child-process (v0.6.5): Extracting archive
[21.0MiB/0.78s] - Installing fidry/cpu-core-counter (1.1.0): Extracting archive
[21.1MiB/0.78s] - Installing clue/ndjson-react (v1.3.0): Extracting archive
[21.1MiB/0.78s] - Installing friendsofphp/php-cs-fixer (v3.58.1): Extracting archive
[21.1MiB/0.84s] - Installing illuminate/conditionable (v11.9.2): Extracting archive
[21.1MiB/0.85s] - Installing psr/simple-cache (3.0.0): Extracting archive
[21.2MiB/0.85s] - Installing illuminate/contracts (v11.9.2): Extracting archive
[21.2MiB/0.86s] - Installing illuminate/macroable (v11.9.2): Extracting archive
[21.2MiB/0.86s] - Installing illuminate/collections (v11.9.2): Extracting archive
[21.3MiB/0.86s] - Installing laravel/prompts (v0.1.23): Extracting archive
[21.3MiB/0.86s] - Installing nunomaduro/termwind (v1.15.1): Extracting archive
[21.3MiB/0.87s] - Installing filp/whoops (2.15.4): Extracting archive
[21.4MiB/0.88s] - Installing nunomaduro/collision (v7.10.0): Extracting archive
[21.4MiB/0.88s] - Installing phpstan/phpstan (1.11.2): Extracting archive
[21.4MiB/0.96s] - Installing sebastian/version (4.0.1): Extracting archive
[21.5MiB/0.96s] - Installing sebastian/type (4.0.0): Extracting archive
[21.5MiB/0.97s] - Installing sebastian/recursion-context (5.0.0): Extracting archive
[21.6MiB/0.97s] - Installing sebastian/object-reflector (3.0.0): Extracting archive
[21.6MiB/0.97s] - Installing sebastian/object-enumerator (5.0.0): Extracting archive
[21.6MiB/0.97s] - Installing sebastian/global-state (6.0.2): Extracting archive
[21.7MiB/0.97s] - Installing sebastian/exporter (5.1.2): Extracting archive
[21.7MiB/0.97s] - Installing sebastian/environment (6.1.0): Extracting archive
[21.7MiB/0.97s] - Installing sebastian/comparator (5.0.1): Extracting archive
[21.7MiB/0.98s] - Installing sebastian/code-unit (2.0.0): Extracting archive
[21.8MiB/0.98s] - Installing sebastian/cli-parser (2.0.1): Extracting archive
[21.8MiB/0.98s] - Installing phpunit/php-timer (6.0.0): Extracting archive
[21.8MiB/0.98s] - Installing phpunit/php-text-template (3.0.1): Extracting archive
[21.9MiB/0.98s] - Installing phpunit/php-invoker (4.0.0): Extracting archive
[21.9MiB/0.98s] - Installing phpunit/php-file-iterator (4.1.0): Extracting archive
[21.9MiB/0.99s] - Installing theseer/tokenizer (1.2.3): Extracting archive
[22.0MiB/0.99s] - Installing sebastian/lines-of-code (2.0.2): Extracting archive
[22.0MiB/0.99s] - Installing sebastian/complexity (3.2.0): Extracting archive
[22.0MiB/0.99s] - Installing sebastian/code-unit-reverse-lookup (3.0.0): Extracting archive
[22.0MiB/0.99s] - Installing phpunit/php-code-coverage (10.1.14): Extracting archive
[22.1MiB/1.00s] - Installing phar-io/version (3.2.1): Extracting archive
[22.1MiB/1.01s] - Installing phar-io/manifest (2.0.4): Extracting archive
[22.1MiB/1.01s] - Installing myclabs/deep-copy (1.11.1): Extracting archive
[22.2MiB/1.01s] - Installing phpunit/phpunit (10.5.20): Extracting archive
[22.2MiB/1.08s] - Installing zhamao/logger (1.1.1): Extracting archive
[19.1MiB/1.77s] 76 packages you are using are looking for funding.
[19.1MiB/1.77s] Use the `composer fund` command to find out more!
[19.1MiB/1.77s] CaptainHook Hook Installer
[19.1MiB/1.77s] CaptainHook executable not found
Make sure you have installed CaptainHook .
If you installed the Cap'n to a custom location you have to configure the path
to your CaptainHook executable using Composers 'extra' config. e.g.
"extra": {
"captainhook": {
"exec": "tools/captainhook.phar
}
}
If you are uninstalling CaptainHook, we are sad seeing you go,
but we would appreciate your feedback on your experience.
Just go to https://github.com/captainhookphp/captainhook/issues to leave your feedback
[19.1MiB/1.77s] Memory usage: 19.09MiB (peak: 42.08MiB), time: 1.77s How do I set the path to CaptainHook ??? |
Beta Was this translation helpful? Give feedback.
-
Using the same container image in the runtime environment |
Beta Was this translation helpful? Give feedback.
-
@crazywhalecc Any news on this ? |
Beta Was this translation helpful? Give feedback.
-
I haven't had the time to try out static-php-cli yet.
I have several microservices built on Swoole. I would like to make an .so file of static-php-cli that all my microservices would load when running the binary - such that the static-php-cli shared library is only taking up space once in the file system - as opposed to statically linking php and/or extensions into the binary of each microservice.
Is this possible using static-php-cli ?
How would I compile each microservice to achieve this ?
Beta Was this translation helpful? Give feedback.
All reactions