PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, January 13, 2022

[FIXED] check for existing, persistent SQLite connection in PHP

 January 13, 2022     persistence, php, sqlite     No comments   

Issue

PHP supports the use of persistent SQLite connection. However, problem arises in trying to run maintenance scripts (like file backup), with such a connection opened. These scripts are likely to be run without a server restart every now and then, on periods of low traffic.

The question is : How to check if there is currently an SQLite persistent connection, without opening / calling one (hence creating the connection).

See: php SQLite persistent connection


Solution

If you have access to shell_exec() or exec you can run a shell command to check to see if a sqlite process is running using something like top or maybe a command like lsof -i -n -P | grep sqlite assuming sqlite is the name of the process.



Answered By - David Weitz
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing