It sounds like you're encountering an issue where the FirebirdSQL driver is not properly installed or enabled on your production server. Here are the steps you should follow to troubleshoot and resolve this issue:
-
Install FirebirdSQL Driver: Ensure that the FirebirdSQL driver (
php-interbase) is installed on your server. You can install it using the following command:
sudo apt-get install php8.2-interbase
- Enable the Extension: After installing the driver, you need to make sure that it is enabled. You can check if the extension is enabled by creating a PHP file with the following content and accessing it via the web:
<?php phpinfo(); ?>
Look for a section related to interbase or pdo_firebird. If you don't see it, you'll need to enable the extension manually.
-
Configure php.ini: Locate your
php.inifile used by your web server (it might be different from the CLI version). You can find the path to thephp.inifile in the output ofphpinfo(). Once you've located the correctphp.inifile, ensure that the following lines are present and not commented out:
extension=interbase.so
extension=pdo_firebird.so
-
Restart Web Server: After making changes to
php.ini, you need to restart your web server for the changes to take effect. If you're using Apache, you can restart it using:
sudo service apache2 restart
Or if you're using Nginx with PHP-FPM, you can restart PHP-FPM using:
sudo service php8.2-fpm restart
-
Configure Laravel: In your Laravel application, make sure you have the correct configuration for your FirebirdSQL connection in your
config/database.phpfile. It should look something like this:
'firebird' => [
'driver' => 'firebird',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', '/path/to/your/database.fdb'),
'username' => env('DB_USERNAME', 'username'),
'password' => env('DB_PASSWORD', 'password'),
'charset' => env('DB_CHARSET', 'UTF8'),
'prefix' => '',
'role' => null,
],
And don't forget to set the environment variables in your .env file.
- Test the Connection: Finally, test the connection to your FirebirdSQL database using Laravel's database tools, such as the Artisan command:
php artisan tinker
Then, within the Tinker shell, try to fetch some data:
DB::connection('firebird')->table('your_table')->get();
If you follow these steps and still encounter issues, double-check that the FirebirdSQL server is running and accessible from your Laravel application, and that the database credentials are correct. If the problem persists, you may need to consult the Plesk documentation or support for any Plesk-specific configuration that might be affecting the PHP extensions.