windows - PHP Built in Server with SQLite

268

I am trying to create a portable web application using PHP's built in server on Windows. I need to have a user authentication system and I figured SQLite was perfect because of it being portable and a small file size. I'm ending up with errors though. (Note: I do not want to edit the php.ini installed by default on my system since this will be given out to other people)

I have this:

$dbh = new PDO('sqlite:sqlite/minepanel.db');

which returns this error:

Fatal error: Uncaught exception 'PDOException' with message 'could not find driver'

With some research, I figured I needed to do something along the lines of having a custom php.ini for my application. I created a php.ini in the directory the built in server runs out of with this content:

sqlite3.extension_dir = "ext"
extension=php_pdo_sqlite.dll
extension=php_sqlite.dll

With my startup script looking like this:

php -S localhost:8000 -c php.ini

I'm confused now as to how to get PHP to talk to SQLite when running PHP's built in server without modifiying the PHP install php.ini

People are also looking for solutions to the problem: php - Internal Server Error: Having trouble with mod_rewrite in .htaccess

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.