From: Reini U. <ru...@x-...> - 2004-08-09 10:41:44
|
Jean-Christian Imbeault schrieb: > I'm trying to get phpwiki up and running with a postgres database and > I'm finding the documentation a bit sparse ... > > Here are my questions/comments so far: > > #1 Do I need to initdb with any special encoding? yes. > (I'm hoping that > phpwiki creates all the tables it needs and with the correct encoding > but I might be wrong). I want to use UTF-8, and have set config.ini to > utf-8 but I am worried that I need to initialize my DB with UTF-8 > encoding too ... > > In a perfect world phpwiki would create the tables using the encoding > given in config.ini regardless of what initdb did. phpwiki does not create the database and does not create any tables. The rest of your questions are not phpwiki specific at all. You have to make your own decisions, based on other (external) libraries and modules. If not, use the default gdbm. > #2 How does one describe a DSN in the config file for a postgres DB > running on the same machine as phpwiki? The config.ini file suggests: > > dbtype(dbsyntax)://username:password@protocol+hostspec/database > > But what is dbtype for postgres? pgsql > pgsql? postgres? postgresql? And what > is the 'protocol+hostspec' string? My dsn is "pgsql://rurban:@localhost/template1" But this is for cygwin, which doesn't run well over sockets. Postgres doesn't use TCP per default, just a socket. so it might something like: "pgsql://user:password@unix+localhost(/var/postgresql/data/postgresql.sock)/template1?persistent=0" Please google for any database documentation on DSN strings. This is not phpwiki specific. See esp. the Pear::DB documentation. * + phptype: Database backend used in PHP (mysql, odbc etc.) * + dbsyntax: Database used with regards to SQL syntax etc. * + protocol: Communication protocol to use (tcp, unix etc.) * + hostspec: Host specification (hostname[:port]) * + database: Database to use on the DBMS server * + username: User name for login * + password: Password for login * The format of the supplied DSN is in its fullest form: * <code> * phptype(dbsyntax)://username:password@protocol+hostspec/database?option=8&another=true * </code> * * Most variations are allowed: * <code> * phptype://username:password@protocol+hostspec:110//usr/db_file.db?mode=0644 * phptype://username:password@hostspec/database_name * phptype://username:password@hostspec * phptype://username@hostspec * phptype://hostspec/database * phptype://hostspec * phptype(dbsyntax) * phptype * </code> > Adding more examples of DSN strings to the config file would be very > useful for first time installers like myself. This was taken from lib/pear/DB.php > #3 From the above example for a DSN I assume that I need to create the > DB myself? I didn't see anywhere in the documentation that said I needed > to create a DB ... why can't phpwiki create the DB itself? Because we have no installer yet. And we didn't want to store the DB root password anywhere. There's a Makefile which you might find useful. You need to set the root name and password though. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |