1

Topic: Install PunBB 1.2.10 with SQLite

Hey everyone, Im new here.

I'm also new in database management. I wanna set up a little server with a fast and easy to maintain message-board. Here are the details:

OpenBSD 3.8
Apache 1.3.29
php5-core-5.0.4p0
php5-sqlite-5.0.4
sqlite-2.8.16

and, as detailed in the title, PunBB 1.2.10.

I tried to install it, but I failed. I opened install.php, gave it a database-name, but if the file doesnt exist it gives me a

PunBB reported: Unable to create new database './my.db'. Permission denied

error, or if I create the file manually and chmod it (not sure what to use anyway) then:

PunBB reported: Unable to open database './my.db'. SQLite reported: malformed database schema - unable to open a temporary database file for storing temporary tables

error. I know there's a way to create a db file which the punbb installer can use but i donno what's that way.

Pls help me, and sorry for my ignorance!

Re: Install PunBB 1.2.10 with SQLite

I think the second error has to do with the fact that SQLite tries to create a temporary table where it doesn't have permission to do so. Google the error message and I'm sure you'll find something.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3 (edited by berVi 2007-01-30 21:31)

Re: Install PunBB 1.2.10 with SQLite

Rickard wrote:

I think the second error has to do with the fact that SQLite tries to create a temporary table where it doesn't have permission to do so. Google the error message and I'm sure you'll find something.

thanks i solved it. actually at the time of writing i was just playing around with this, but now i really need this and im a bit more into web serving stuff.

in my current setup i have user htdocs which i use to upload things to the docroot. htdocs user is in www group, which also includes the www user which runs httpd.

the permissions are setted up like this:
chown -R htdocs:www /var/wwwhtdocs
chmod -R 0750 /var/www/htdocs

then i got the access error again. after googling and playing around with it, i realized how to do the thing.

in upload dir where punbb files are

mkdir db
chmod 0770 db

now run the installer, with db in db/test.db. it successfully creates the database. the problem is discucced here

this is most likely caused by the fact that some versions of SQLite attempt to create a temporary file in the current directory. If that fails, because Bacula does not have write permission on the current directory, then you may get this errr. The solution is to start Bacula in a current directory where it has write permission.

thats why the installer (which is ran by user www) needs that 0770 on db dir. anyway the explanation above does not completely apply to our case since punbb doesnt need write permission on the _current_ dir but on the one that will contain the db file.

after install completed, it warns me to fix permissions on cache and avatar, i solved it and all was fine.

chmod 0770 cache

after first run it created a few new files

chown -R htdocs:www cache
chmod 0760 cache/cache*

after these there still remained a problem: anyone could download the db file by going to http://hostname/upload/db/test.db, so i had to copy the .htaccess file from cache dir.

i hope this will help someone setting up punbb. of course you have a different setup so you have to modify these steps.

program versions in my setup:

OpenBSD 4.0-stable
OpenBSD httpd (Apache 1.3.29 fork)
php5-core-5.1.4p1-hardened
php5-sqlite-5.1.4-hardened
sqlite-2.8.17p1

Ricard, i suggest you to update the installer doc to inlude some notes about the required permissions to create a new sqlite db.