I'm using a Synology DS213 with DSM 6.2.2-24922. It appears to have a php engine even before I install any php packages on it. Unfortunately it won't let me connect to any database at it appears none of those extensions have beens allowed.
It appears my current php.ini file is located at /etc/php/php.ini and I could find the following extensions:
extension = bcmath.so
extension = bz2.so
extension = curl.so
extension = iconv.so
extension = ldap.so
extension = mcrypt.so
extension = openssl.so
extension = pdo_sqlite.so
extension = posix.so
extension = phar.so
extension = shmop.so
extension = sockets.so
extension = sqlite3.so
extension = zip.so
extension = syno_compiler.so
As you can see, pdo_mysql and mysqli are not supported. I tried adding them in, but that would give me the error that the file was missing.
I then tried working with the package manager and installed Web Station with PHP 5.6 and 7.2. This appears to have had no effect, as my default php was not changed whatsoever.
I verified this the following way:
root@DiskStation:/etc/php# php --ini
Configuration File (php.ini) Path: /etc/php
Loaded Configuration File: /etc/php/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
As you can see, it's still calling the default php.ini instead of the new ones I got from my packages.
All I want to do is very simple. I'm running a PHP script which is calling an api. It parses the response and writes it to the MariaDB 10 also located on the Synology NAS. Calling the api already works, but actually getting a connection to the database is proving to be rather difficult.
It's pretty simple to do really, but it's so user friendly that if you're used to handling this stuff "normally," like via configuration files, you'll feel some pain.
These instructions are valid as of DMS 6.2.4.
Open the main menu (upper left corner):

Open WebStation:

Select the version of PHP you want to enable extensions for, and click 'edit':

Choose which PHP modules to enable:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With