Henry Finnell
Henry Finnell

Reputation: 3

PHP file that uses mysqli not running on synology diskstation

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

Upvotes: 0

Views: 1813

Answers (1)

Dharman
Dharman

Reputation: 33373

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

Upvotes: 1

Related Questions