note 58108 deleted from function.sqlite-query by cmb
| From: | cmb@php.net | Date: | Mon, 02 Nov 2020 15:02:56 +0000 |
| Subject: | note 58108 deleted from function.sqlite-query by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215754@lists.php.net to get a copy of this message | ||
Note Submitter: jason at fatpipeinc dot com
----
sqlite_open will return NULL if the web server cannot write to the sqlite database file.
I saw the following message in my web server error log:
PHP Warning: sqlite_query(): (null) ...
It turns out that the sqlite database file was owned by a user other than the one the web server was
running as. In my case, it was a Linux system running Apache (which was running under the context
of user apache). The sqlite database file was owned by root. I changed ownership of the file to
user apache and now it works! The sqlite_open call now returns a valid result handle.
Jason Aeschilman