Synology: How to Change Default PHP Version in DSM

Synology How to Change Default PHP Version in DSM

Did you know your current DSM 6.2.4 runs PHP 5.6 as the default PHP version? In today’s article I will teach you how to change the default PHP 5.6 version in your DSM with a newer version. PHP 5.6 will no longer receive official protection from PHP.net as of January 1st, 2019. The developers of PHP are no longer supporting PHP 5.6. There will not be any more security updates to PHP 5.6, there will not be any more bug fixes to PHP 5.6. You should not use PHP 5.6 (or any version of PHP 5) in a production environment. There are a number of deprecated and out-of-date functions and libraries that should no longer be used for security reasons, not even on your Synology NAS.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

Follow my easy step by step guide on how to SSH into your Synology NAS.

  • STEP 3

Update your current DSM PHP version from 5.6 to 7.3 – After login via SSH, copy paste the instructions below one by one without the words “press enter“.  For example, you have to press enter on your keyboard after you write sudo -i.

sudo -i press enter
cd /usr/bin press enter
mv php php56 press enter
cp /volume1/@appstore/PHP7.3/usr/local/bin/php73 php press enter
  • STEP 4

Update your current DSM PHP version from 5.6 to 7.4 – After login via SSH, copy paste the instructions below one by one without the word “press enter“. For example, you have to press enter on your keyboard after you write sudo -i.

sudo -i press enter
cd /usr/bin press enter
mv php php56 press enter
cp /volume1/@appstore/PHP7.4/usr/local/bin/php74 php press enter

Note: DSM 7 already uses PHP 7.3 as the default PHP version.

Rollback from PHP 7.3 to PHP 5.6 “Restore the PHP to a previously defined state”.

sudo -i press enter
cd /usr/bin press enter
mv php php73 press enter
cp /volume1/@appstore/PHP5.6/usr/local/bin/php56 php press enter

Rollback from PHP 7.4 to PHP 5.6 “Restore the PHP to a previously defined state”.

sudo -i press enter
cd /usr/bin press enter
mv php php74 press enter
cp /volume1/@appstore/PHP5.6/usr/local/bin/php56 php press enter

Note: If something go wrong for one reason or another just reinstall the latest DSM 6.2.4 in your NAS. You will no lose any files.

This post was updated on Wednesday / March 3rd, 2021 at 7:21 PM