Last active
September 26, 2025 15:11
-
-
Save Halleck45/3b2fffa829d2af34235aa7355cdfb7f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Creating phar | |
# ------------------------------------- | |
# Download | |
composer require --dev bamarni/composer-bin-plugin | |
composer bin box require --dev humbug/box | |
# Build phar | |
./vendor/bin/box compile | |
# | |
# Installing Static-php-cli (SPC) | |
# ------------------------------------- | |
# Download | |
curl -fsSL \ | |
-o spc.tgz \ | |
https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64.tar.gz \ | |
&& tar -zxvf spc.tgz && rm spc.tgz | |
# Dependencies | |
./spc doctor --auto-fix | |
./spc download --with-php=8.4 --for-extensions \ | |
"apcu,curl,dom,fileinfo,filter,intl,mbstring,mysqlnd,openssl" \ | |
--prefer-pre-built | |
# Optional (to optimize the final build) | |
./spc install-pkg upx | |
# | |
# Build the final binary | |
# ------------------------------------- | |
# Build | |
./spc build --build-micro \ | |
"apcu,curl,dom,fileinfo,filter,intl,mbstring,mysqlnd,openssl" \ | |
--with-upx-pack | |
./spc micro:combine mon_fichier.phar \ | |
--output=my-binary-linux-x86_64 | |
chmod +x my-binary-linux-x86_64 | |
# Now you can run: | |
./my-binary-linux-x86_64 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment