Home > Back-end >  PHP file that uses mysqli not running on synology diskstation
PHP file that uses mysqli not running on synology diskstation

Time:10-19

When I attempt to run a PHP file containing mysqli functions through command line it throws an error like Fatal error: Uncaught Error: Call to undefined function mysqli_connect() The same file runs perfectly through the built-in web station app so naturally, I tried running it with the -c parameter and specifying the same file that PHP is run with through the web station app:

php -c /usr/local/etc/php73/cli/php.ini /volume1/web/test.php

But I still get the same error so I am at a loss as to what the issue could be here

CodePudding user response:

Synology Diskstation has a concept of packages. PHP packages are installed with a specific version number. When you want to use the same setup that you have in Web Station you must use the appropriate PHP version.

If you are using PHP 7.3 package then try executing it with php73

php73 /volume1/web/test.php
  • Related