How to add SQLite to LAMP Proof of Concept project



I remixed this project:!/lamp-poc to have Apache and PHP in my own project (!/tart-cemetery). It comes with MySQL, but I’d like to use SQLite. While the command line tool “sqlite” is available in the console, the line “extension=sqlite” and “extension=pdo_sqlite” needs to be in the php.ini file or in a file in the /etc/php/7.0/apache2/conf.d/ directory. Unfortunately, neither is writable by the “app” user.

How can I get extensions into PHP for my project (or specifically, these two extensions)? I’d like to use this to teach my PHP class at university.


We added a php.ini to the lamp-poc project. PHP will read that one before the one in /etc, and you have write access to that file. It looks like SQLite is happy now. You can remix again or just copy that file.