I was in the same boat–trying to get PHP 7.0 to work on the command-line of my Synology DiskStation DS218+.
I typed php70 --ini
and I found out that PHP was using an INI file located at /usr/local/etc/php70/php.ini
.
I went to the directory
cd /usr/local/etc/php70/
Made a backup of the .ini
file just incase.
sudo cp php.ini php.ini.bak
Opened vi
.
sudo vi php.ini
Hit i
to enter Insert
mode. I changed from this:
extension_dir = "/usr/local/lib/php70/modules"
to this:
extension_dir = "/volume1/@appstore/PHP7.0/usr/local/lib/php70/modules"
I also added this line:
extension = pdo_mysql.so
I then hit Esc
, followed by :
then wq
and . This leaves insert mode, writes the .ini
to disk, and quits.
That's it! After that, I was able to run command-line scripts by invoking php70
followed by the script name.
php.ini
files. One for use with Apache and one exclusively for the PHP CLI. Runphp --ini
and see where you PHP CLI ini file actually lives – Melanoid