0

My SQLite3 file is in /tmp and I have been accessing it with nginx and php-fpm since last year. Since I updated my system recently from e. g. PHP 7.0->7.1 I can not access the datebase file in /tmp. If it is in current dir it works like a charm. I have not set "open_basedir". If I open the file in /tmp with

$db = new SQLite3('/tmp/temperatures.sqlite');

I get no error but the database is empty e. g. sqlite_master returns nothing and SELECTs on my tables return "no such table".

Timon
  • 31
  • 2
  • Not an answer, but I'd be carefull with files in `/tmp`, a reboot can clear that directory, so only if it is actually really temporary i'd have a file there. Of course it depends on system OS etc, but still. As for your issue, it might be an issue with rights, but I can't think of a way that this dot-version upgrade would do this. – Nanne Apr 01 '17 at 10:24
  • What makes you think that your database file is still there? – CL. Apr 01 '17 at 18:37
  • I can see it in the filesystem and read it with no problems e. g. with sqlite3, mcedit or the DB Browser GUI. My python script is writing temperatures into a table every minute. And because it is a runnung on a raspberry with sdcard, I put it in /tmp for less written sectors. For now I am using a self-written systemd service which copies the database in /tmp on startup and copies it back to the sdcard on shutdown. – Timon Apr 02 '17 at 06:51
  • For anyone who reads this: As the database can be read from other directories it is moved to, it should be caused by the PrivateTmp security feature where every process gets its own /tmp and /var/tmp. – Timon May 06 '17 at 13:17

0 Answers0