Search code examples
phpmysqlcommand-line-interfacesynology

How to execute PHP CLI script with extension on synology


I'm trying to execute a php script via command line on my synology NAS. Via web browser it's working fine. However, via CLI I'm getting an error although I loaded the extensions in /etc/php/php.ini.

Fatal error: Uncaught PDOException: could not find driver in /volume1/web/blabla.php:16

Any ideas?


Solution

  • Just make sure to use the correct PHP version and PHP.ini. You can find the location of your php.ini by typing "php --ini". You can also do that on the executables php56/php70. They all have separate php.ini files. Additionaly make sure to load the correct extension directory in the applicable php.ini file.