PHPSandbox notebooks provide built-in support for SQLite databases. The path to the SQLite database is stored in an environmental variable named DB_DATABASE - usually /var/www/database.sqlite. Although this functionality is available for all notebooks, you have the flexibility to create your own SQLite database and incorporate it into your project. All notebook containers includes a respective phpX-sqlite3 extension, allowing them to seamlessly interact with any SQLite database you prefer.


Every notebook is equipped with standard MySQL and PostgreSQL extensions already installed, allowing you to utilize MySQL or PostgreSQL databases in your projects. Whether you want to connect natively using mysqli_* functions for MySQL or pg_* functions for PostgreSQL or using PDO, you are covered since all these comes out of the box by default. However, we do not currently provide built-in support for MySQL or PostgreSQL servers. This implies that your notebooks do not include a running instance of either of these popular database servers. Nevertheless, since notebooks have the necessary extensions(MySQL, PostgreSQL and PDO) available, you can connect to any external PostgreSQL or MySQL server from your notebook once you have the necessary server credentials to establish a connection. Popular external services for this purpose include Amazon RDS and Heroku JAW DB, among others.

Environment variables