Skip to content

flathub/org.freedesktop.Sdk.Extension.php83

Repository files navigation

org.freedesktop.Sdk.Extension.php83

This extension adds PHP support to Flatpak.

PHP installs to /usr/lib/sdk/php83 inside the sandbox.

Example Visual Studio Code Configuration

"php.validate.executablePath": "/usr/lib/sdk/php83/bin/php",
"php.executablePath": "/usr/lib/sdk/php83/bin/php",

Includes

Each Flatpak can have its own custom php configuration files. e.g. for Visual Studio Code ~/.var/app/com.visualstudio.code/config/php/8.3/ini/my-custom.ini or /var/config/php/8.3/ini/my-custom.ini from a sandboxed shell.

Global composer installs are limited to the Flatpak they were installed in.

Troubleshooting

/usr/bin/env: ‘php’: No such file or directory

Run . /usr/lib/sdk/php83/enable.sh or add /usr/lib/sdk/php83/bin to your $PATH.

Modules

bash-5.0$ php -m
[PHP Modules]
apcu
bz2
Core
ctype
curl
date
dom
fileinfo
filter
hash
iconv
intl
json
libxml
mbstring
openssl
pcntl
pcre
PDO
pdo_sqlite
Phar
posix
random
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xdebug
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]
Xdebug

Build

flatpak-builder --repo repo .build org.freedesktop.Sdk.Extension.php83.json --force-clean