Need sample sqlite config file

Having trouble installing serendipity?
Post Reply
nealk
Regular
Posts: 26
Joined: Sun Sep 20, 2009 1:09 am

Need sample sqlite config file

Post by nealk » Wed Apr 08, 2015 10:37 pm

Background:
My s9y installation is currently on GoDaddy. I'm moving it to a different server because their SQL database system has become unreliable (SQL timeouts for no discernible reason).

The old (GoDaddy) server used mysql.
The new server uses sqlite.

I've already exported the database into an sqlite3 db file.

Does someone have a sample serendipity_config_local.inc.php so I know what values to put in it for the new sqlite db files?

Oh: I'm running 1.7.8, not 2.x. (I like how stable 1.7.8 is. I'll migrate to 2.x after it has a few months without updates/fixes.)

User avatar
yellowled
Regular
Posts: 7007
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Need sample sqlite config file

Post by yellowled » Wed Apr 08, 2015 10:45 pm

nealk wrote:I'm running 1.7.8, not 2.x. (I like how stable 1.7.8 is. I'll migrate to 2.x after it has a few months without updates/fixes.)
Can't help with sqlite unfortunately, but regular updates and fixes are not a sign of an “unstable” software. They are a sign that the software is actively maintained. :)

2.x was released 2 1/2 months ago, and most of the fixes in 2.0.1 were kind of minor (technically even the security fix). Yes, it's still being worked on, but it's not like it's unusable.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

nealk
Regular
Posts: 26
Joined: Sun Sep 20, 2009 1:09 am

Re: Need sample sqlite config file

Post by nealk » Wed Apr 08, 2015 11:37 pm

yellowled wrote:
nealk wrote:I'm running 1.7.8, not 2.x. (I like how stable 1.7.8 is. I'll migrate to 2.x after it has a few months without updates/fixes.)
Can't help with sqlite unfortunately, but regular updates and fixes are not a sign of an “unstable” software. They are a sign that the software is actively maintained. :)

2.x was released 2 1/2 months ago, and most of the fixes in 2.0.1 were kind of minor (technically even the security fix). Yes, it's still being worked on, but it's not like it's unusable.

YL
Thanks YL.

I certainly didn't mean to slam 2.x. I almost never take anything that is less than 4 months stable for a production server. And I only patch when (1) there is a known security risk, and (2) the patch has been deployed enough to be called stable. I like 1.7.8 because it is very stable.

Anyway, any help on the sqlite config would be appreciated.

User avatar
onli
Regular
Posts: 2222
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Need sample sqlite config file

Post by onli » Thu Apr 09, 2015 9:13 am

Hi
Here is mine:

Code: Select all

onli@boatfly:~$ cat /var/www/serendipity_config_local.inc.php 
<?php
	/*
	  Serendipity configuration file
	  Written on Thu, 05 Mar 2015 16:07:47 +0100
	*/

	$serendipity['versionInstalled']  = '2.1-alpha1';
	$serendipity['dbName']            = 'serendipity_21a28e3cd5e2d8d30dd860337ea8cc52';
	$serendipity['dbPrefix']          = 'serendipity_';
	$serendipity['dbHost']            = 'localhost';
	$serendipity['dbUser']            = 'onli';
	$serendipity['dbPass']            = '';
	$serendipity['dbType']            = 'pdo-sqlite';
	$serendipity['dbPersistent']      = false;
	$serendipity['dbCharset']         = 'latin1';

	// End of Serendipity configuration file
	// You can place your own special variables after here:

?>

User avatar
yellowled
Regular
Posts: 7007
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Need sample sqlite config file

Post by yellowled » Thu Apr 09, 2015 12:35 pm

nealk wrote:I almost never take anything that is less than 4 months stable for a production server. And I only patch when (1) there is a known security risk, and (2) the patch has been deployed enough to be called stable.
Perfectly acceptable. So, it's a Debian server? :wink:

It just seems as if we encounter a lot of people in the forums lately that still use 1.6.x or even 1.5.x, and that's not really an option these days.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

nealk
Regular
Posts: 26
Joined: Sun Sep 20, 2009 1:09 am

Re: Need sample sqlite config file

Post by nealk » Thu Apr 09, 2015 6:38 pm

Thanks onli!

I did some tweaking and learned:

1. Sqlite does not require username or password. (Makes sense since you have the file.)

2. $serendipity['dbName'] is the path to the DB file. You can even set this to something like "../../databases/mydb" for accessing mydb.db outside of the web directory. (No need for .htaccess to prevent access when it isn't in the directory!)

3. $serendipity['dbType'] = 'pdo-sqlite'; is the correct key to accessing this. On Ubuntu, you will need 'apt-get install php5-sqlite' and restart the web server.

4. $serendipity['dbType'] = 'sqlite'; does not work as of PHP 5.5. Specifically, sqlite_open() no longer exists. (It was deprecated for sqlite3_open, and in PHP 5.5, they removed it.)

5. I didn't realize that the relative path to all files is stored in the DB! This really should be moved into serendipity_config_local.inc.php. I had to update this value when I moved my server.
sqlite> update s_config set value='/home/new_home/www/blog/' where name='serendipityPath';

Also, I made the baseURL hostname independent (makes the code work for HTTP or HTTPS, and for any of the hostname aliases that I use):
update s_config set value='/blog/' where name='baseURL';

New DB and ported install works great!

User avatar
onli
Regular
Posts: 2222
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Need sample sqlite config file

Post by onli » Thu Apr 09, 2015 7:02 pm

Thanks for documenting your steps.
nealk wrote:Also, I made the baseURL hostname independent (makes the code work for HTTP or HTTPS, and for any of the hostname aliases that I use):
update s_config set value='/blog/' where name='baseURL';
Just as a note: We have an option to autodetect the baseURL, that should take care of HTTP/HTTPS as well.

Post Reply