Hi all,
I tried a fresh "shared" installation of 2.0 with sqlite tonight and after setup, clicking "Visit your new blog here" got the following error:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [14] unable to open database file' in /usr/local/lib/php/serendipity2/s9y/include/db/pdo-sqlite.inc.php:105 Stack trace: #0 /usr/local/lib/php/serendipity2/s9y/include/db/pdo-sqlite.inc.php(105): PDO->__construct('sqlite:/usr/loc...') #1 /usr/local/lib/php/serendipity2/s9y/serendipity_config.inc.php(295): serendipity_db_connect() #2 /home/me/serendipity/serendipity_config.inc.php(8): require_once('/usr/local/lib/...') #3 /usr/local/lib/php/serendipity2/s9y/index.php(23): include('/home/me/serend...') #4 /home/me/serendipity/index.php(6): require_once('/usr/local/lib/...') #5 {main} thrown in /usr/local/lib/php/serendipity2/s9y/include/db/pdo-sqlite.inc.php on line 105
My open_basedir is:
"/tmp:/usr/local/lib/php/:/usr/local/lib/php/serendipity2/s9y/:/home/me/serendipity/"
DB file is created OK and listed correctly in serendipity_config_local.inc.php.
https user ("apache") has write access to both the db and the main directory (verified since it created the db OK).
Any thoughts...?
Can't open sqlite DB in shared 2.0 fresh install...
Re: Can't open sqlite DB in shared 2.0 fresh install...
just guessing..., this is while the db resides in open_basedir path, but Serendipity path is in /home/..
Try with /include/db/pdo-sqlite.inc.php(105)
As a one-liner before:and then:
What does it do?
Try with /include/db/pdo-sqlite.inc.php(105)
As a one-liner before:
Code: Select all
$serendipity['dbConn'] = new PDO('sqlite:' . $serendipity['serendipityPath'] . $serendipity['dbName'] . '.db');
Code: Select all
$serendipity['dbConn'] = new PDO('sqlite:' . $serendipity['dbName'] . '.db');
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Re: Can't open sqlite DB in shared 2.0 fresh install...
Thanks Timbalu! That fixes the problem but I don't fully understand why...
Serendipity is installed in /usr/local/lib/php/serendipity2/s9y since it's a shared installation but the database is created (by default) in /home/me/serendipity/. The open_basedir contains "/home/me/serendipity/."
Your fix seems to indicate that $serendipity['serendipityPath'] is "/usr/local/lib/php/serendipity2/s9y" in the shared install case. Is that true?
So, my other question is, how can I accomplish this fix without having to patch /include/db/pdo-sqlite.inc.php(105)?
Thanks for your help fixing it in the first place!!
Serendipity is installed in /usr/local/lib/php/serendipity2/s9y since it's a shared installation but the database is created (by default) in /home/me/serendipity/. The open_basedir contains "/home/me/serendipity/."
Your fix seems to indicate that $serendipity['serendipityPath'] is "/usr/local/lib/php/serendipity2/s9y" in the shared install case. Is that true?
So, my other question is, how can I accomplish this fix without having to patch /include/db/pdo-sqlite.inc.php(105)?
Thanks for your help fixing it in the first place!!
Re: Can't open sqlite DB in shared 2.0 fresh install...
I don't know. What does the Configuration - Path - Full Path option field say?latcarf wrote:Your fix seems to indicate that $serendipity['serendipityPath'] is "/usr/local/lib/php/serendipity2/s9y" in the shared install case. Is that true?
It depend on how this should work. Maybe the local db install in /home is totally OK, since a shared installation having each users its own database. So maybe we need to reset the sqlite $serendipity['serendipityPath'] for shared installs.latcarf wrote:So, my other question is, how can I accomplish this fix without having to patch /include/db/pdo-sqlite.inc.php(105)?
I think we will have to wait for Garvin showing up, to give some concrete suggestions on what to do here.
Edit: I had some more thoughts on this ... maybe you should write for shared installs
Code: Select all
$serendipity['dbConn'] = new PDO('sqlite:' . S9Y_DATA_PATH . $serendipity['dbName'] . '.db');
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Can't open sqlite DB in shared 2.0 fresh install...
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Can't open sqlite DB in shared 2.0 fresh install...
Awesome! Thanks.Fixed here: https://github.com/s9y/Serendipity/issu ... t-54944875