Scripts ending in
.php will be executed with
Changing PHP options
Many PHP configurable options can be set by setting their values in a
.user.ini file located in the directory where you want things changed. From
the PHP Manual's list of php.ini
directives, you can change any listed
where the "Changeable" column says either "PHP_INI_PERDIR" or "PHP_INI_ALL".
For example, your
.user.ini might contain:
upload_max_filesize = “30M”
Choosing a version of PHP
You can choose among multiple versions of PHP:
|PHP version||Command-line path||Sunset Date|
|8.0||/opt/remi/php80/root/usr/bin/php||November 26, 2023|
|8.1 (default)||/opt/remi/php81/root/usr/bin/php||November 25, 2024|
|8.2||/opt/remi/php82/root/usr/bin/php||December 8, 2025|
The default version of PHP was changed from 8.0 to 8.1 on January 9, 2023.
PHP 7.4 was removed on December 19, 2022. Sites configured for PHP 7.4 began using the default version at that time.
If you need to switch PHP versions, you can do so by creating or editing your
.silk.ini file (for example
~/www-root/.silk.ini) and adding the
version to the
[php] version = 8.2
Valid version choices are
default, any of the versions listed in the table
newest (which provides the newest available on the system).
Your PHP processes should restart with any version changes within a few
minutes. If you would like changes to take effect immediately, type
pkill -u <myusername> php-cgi.
PHP versions from the command-line and scheduled tasks
Since multiple version of PHP are available, make sure you call the intended
version. The version of PHP you call by default from the command-line should
be the version specified in your
~/www-root/.silk.ini file. To call another
version, or to call the correct one from a scheduled task, use its full path,
listed in the table above.
Upgrading from PHP 7.4
As a major (x.0) release, PHP 8.0 introduces a number of new features while removing previously deprecated features and fixing existing undesirable behavior. Migrating to PHP 8.0 might require more testing for existing code than minor (x.y) releases.
A complete list of changes can be found in the PHP documentation at Migrating from PHP 7.4.x to PHP 8.0.x. In particular, note the list of backward incompatible changes.
Upgrading from PHP 8.0
A complete list of changes can be found in the PHP documentation at Migrating from PHP 8.0.x to PHP 8.1.x. In particular, note the list of backward incompatible changes.
Upgrading from PHP 8.1
A complete list of changes can be found in the PHP documentation at Migrating from PHP 8.1.x to PHP 8.2.x. In particular, note the list of backward incompatible changes.
Composer is a popular library dependency manager for PHP. Once you declare what packages your project needs, Composer can install them and keep them up to date. You can see what packages are available at Packagist.
A recent version of
composer is available in your