Report this

What is the reason for this report?

Enable Interbase Module for php

Posted on May 7, 2015

We have a wordpress site with scripts that need to write to an Interbase db. Our developer attempted to add the extension to php via “extension=php_interbase.so” in php.ini to no avail. We use serverpilot and here is their answer “For Interbase, we build PHP with ODBC support. So, you’ll need to connect to your Interbase database server over ODBC.”

What would be the easiest way to do this? Can we add the php extension somehow or do we have to use the ODBC driver (with or without serverpilot)? As we have other sites coming over to DO, we want to get this right the first time and, though we like serverpilot, we are not tied to it.

We are running on the latest version of Ubuntu.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I cannot speak to whether this is possible with ServerPilot but our own one-click Wordpress image which uses the versions of Apache and PHP provided by Ubuntu would support installing interbase support with:

apt-get update;
apt-get install php5-interbase;
service apache2 restart;

If you need to connect to an Interbase database from your WordPress site and your server is running the latest version of Ubuntu, you have a couple of options. It appears that ServerPilot uses PHP built with ODBC support for Interbase, so you can either use ODBC or explore alternative server management solutions like manual server configuration or alternatives to ServerPilot.

Here are the steps to connect to an Interbase database from your WordPress site using ODBC:

  1. Install ODBC and Interbase Support: First, ensure that you have the required packages installed on your server. You’ll need the UnixODBC driver manager and the Firebird ODBC driver for Interbase. You can install them using the following commands:
sudo apt-get install unixodbc unixodbc-dev
sudo apt-get install firebird-dev
  1. Configure ODBC Data Source: Create an ODBC Data Source Name (DSN) to define the connection to your Interbase database. You can do this by creating an ODBC configuration file, typically located at /etc/odbc.ini. Add an entry like this:
[MyInterbaseDSN]
Description     = My Interbase Database
Driver          = /usr/lib/x86_64-linux-gnu/odbc/libinterbase.so
Database        = /path/to/your/interbase/database.fdb
ServerType      = 0

Adjust the Driver and Database paths to match your server configuration.

  1. Install PHP ODBC Extension: Ensure that the PHP ODBC extension is installed and enabled. You can typically enable it by running:
sudo apt-get install php-odbc

You may need to restart your web server after installing the extension.

  1. Connect to the Interbase Database: In your WordPress PHP code, you can use ODBC functions to connect to the Interbase database using the DSN you configured. Here’s an example:
$dsn = "MyInterbaseDSN";
$user = "your_db_username";
$password = "your_db_password";

$conn = odbc_connect($dsn, $user, $password);

if (!$conn) {
    die("Connection failed: " . odbc_errormsg());
}

// Now, you can execute queries using $conn

Replace your_db_username and your_db_password with your Interbase database credentials.

By following these steps, you should be able to connect to your Interbase database using ODBC from your WordPress site.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.