I tested a simple
Php program using
Sqlite3 instead of
mySQL on my own computer and it works fine. What the program does is simple insert of record into a certain table. Now, when I try to do that on a remote web server running on
Linux (CentOS) with
Sqlite3 enabled it does not work.
I thought at first it was simply a file permission issue since my
Sqlite file had an initial permissions of 644 so I changed it to 646 then 767 both to no avail.
Php version by the way on web server is a little bit dated, namely,
Php 5.1.6 but on my local PC it is 5.5.11.
This is the sample code that I ran on both servers.
$db = new PDO('sqlite:test.db'); $lastname = "Doe"; $firstname = "John"; $sql = "INSERT INTO people (Lastname,Firstname) VALUES (:lastname,:firstname)"; $q = $db->prepare($sql); $q->execute(array(':lastname'=>$lastname, ':firstname'=>$firstname));
I tried a simple query on a sqlite3 database on the webserver by the way and it works.
So, could this be a simple
Php version issue or some elevated rights that I need on Linux?
I cannot by the way change the
php.ini so forgo that possible direction for the moment. And I don't have any choice of having a new
Php version on that server since I use it for free.
I tried to asked this same question SO but to no avail so I am trying my luck here.