Synology NAS – PHP

Enabling extensions in PHP CLI

Become root
Find out which configuration file is used:
php --ini

I get:
Configuration File (php.ini) Path: /usr/local/etc/php70
Loaded Configuration File: /usr/local/etc/php70/php.ini

Edit the php.ini file, check/change extensions dir to where it is located. If PHP was installed through DSM it should be something like ‘/volume1/\@appstore/PHP7.0’
extension_dir = "/volume1/@appstore/PHP7.0/usr/local/lib/php70/modules/"

Enable the extensions you wish to use:
extension =
extension =
extension =
extension =
extension =

Installing Composer

Composer documentation

Become root
Enable the extensions as above (phar, openssl and zip are needed for Composer).

Get and install Composer:
cd /usr/local/bin
curl -s | php70

Create shortcut script ‘composer’ in /usr/local/bin:
php70 /usr/local/bin/composer.phar $*

Set permissions:
chmod --reference=composer.phar composer

composer --version