Reputation: 11
I'm building an application on IBM Bluemix using CloudFoundry. I managed to deploy php-buildpack. How can I enable also SQLite Support? ...I'm not even sure if sqlite is included in the buildpack as there is only "pdo_sqlite" listed as an extension.
If I can't get sqlite support out of this buildpack, is there any other way how to have sqlite support?
Upvotes: 1
Views: 1326
Reputation: 1943
Although the instructions in Jeff Sloyer's answer is correct, you might want to reconsider using sqlite. SQLite is an in-process database and its contents are backed up on the filesystem. Within Bluemix/Cloud Foundry, the filesystem that you run your application on is ephemeral, meaning that each time you restart your application you will lose anything you saved onto the filesytem, thus you will lose the contents of your database.
Upvotes: 3
Reputation: 4964
You have to enable the library in .bp-config/options.json
file. Like the example below
{
"PHP_EXTENSIONS": ["pdo_sqlite"]
}
PDO is just a wrapper around database access in PHP, for more info check out what is the difference between sqlite3 and pdo_sqlite on StackOverflow.
If you run phpinfo()
on your app you will see SQLite3 is installed.
If you run the following.
if (class_exists('SQLite3')) {
echo "sqlite3 is here";
}
It will return and say sqlite3 is installed.
Upvotes: 0