Fatal error when installing SMF 2.0b4

Started by Whenstay, December 09, 2008, 09:59:46 AM

Previous topic - Next topic

Whenstay

Hello ! :)

I am trying to install SMF v2.0 beta4 forum on a french webhost : hxxp:www.free.fr/ [nonactive] with a PostgreSQL database.
To simplify, I called my website "hxxp:toto.titi.free.fr/". [nonactive]

Here is my problem :
QuoteFatal error: Call to undefined function: pg_version() in /mnt/102/sda/4/9/toto.titi/install.php(792) : eval()'d code on line 1

Warning: Unknown(): open(/mnt/102/sda/4/9/toto.titi/sessions/sess_98e86c6b5f3dca0f34dde75b8f7f3226, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of hxxp:session.save [nonactive]_path is correct (/mnt/102/sda/4/9/toto.titi/sessions) in Unknown on line 0

I get it after typing :

Database type: PostgreSQL
Server name: localhost (or "sql.free.fr/phpPgAdmin/")
Username: toto.titi
Password: ********
Database name: toto.titi (or "smf")
Database prefix: smf_

Thanks for your help ! ;)

Jade Elizabeth

Did you create the database and the username for the database?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Whenstay

Yes, I have got a database and an account "toto.titi".

Oldiesmann

#3
The first error is due to your host using PHP 4.x - that function only exists in PHP 5 apparently. I'll go file a bug report about that.

You will need to talk to your host about the other errors - for some reason PHP wasn't able to save the session data.
Michael Eshom
Christian Metal Fans

Whenstay

The host support php5 since 2006.

I was wondering if the problem can be the PostgreSQL database, and if it would be better to switch to a MySQL one ?

Whenstay

Testing different things, I tryed with a Fluxbb forum and everything works with these parameters :
Database type: PostgreSQL
Server name: localhost
Username: toto.titi
Password: ********
Database name: toto.titi
Database prefix: flux_
Not any error and I chech the PostgreSQL database which has been correctly created. ::)

Whenstay

I have the choice of the database encodage :
- SQL_ASCII
- LATIN1 / ISO8859-1
- LATIN9 / ISO8859-15
- Unicode, 8 bits

It was on SQL_ASCII, I don't know if it can help ?

Whenstay

#7
"Warnings" fixed by creating a "sessions" directory, but fatal error still here... ^^
Maybe the host is using php4.x after all. :P

Does it come from here ?
'postgresql' => array(
'name' => 'PostgreSQL',
'version' => '7.4.10',
'function_check' => 'pg_connect',
'version_check' => '$version = pg_version(); return $version[\'client\'];',
'supported' => function_exists('pg_connect'),
'always_has_db' => true,
'validate_prefix' => create_function('&$value', '
$value = preg_replace(\'~[^A-Za-z0-9_\$]~\', \'\', $value);

// Is it reserved?
if ($value == \'pg_\')
return $txt[\'error_db_prefix_reserved\'];

return true;
'),
),


Thank you ! :)

Edit : PHP Version 4.4.3-dev AND PHP Version 5.1.3RC4-dev

To use the php5 version, I must rename file extension (".php" -> ".php5") or include the "php 1" line in a ".htaccess" ^^.

2nd edit : it solve the problem, thank you Oldiesmann for your clairvoyance ! :p

To reward me, SMF send me three new errors ! ^^
QuoteWarning: pg_escape_string() expects exactly 1 parameter, 2 given in /mnt/102/sda/4/9/toto.titi/Sources/Subs-Db-postgresql.php on line 135

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/lang_index+Modifications_french_default.php) is not within the allowed path(s): (/mnt/102/sda/4/9/toto.titi) in /mnt/102/sda/4/9/toto.titi/Sources/Load.php on line 1801

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/lang_Errors_french_default.php) is not within the allowed path(s): (/mnt/102/sda/4/9/toto.titi) in /mnt/102/sda/4/9/toto.titi/Sources/Load.php on line 1801

Oldiesmann

#8
First one: Known bug.

To fix:
Sources/Subs-Db-Postgresql.php

Find
Code (Line 135) Select
return sprintf('\'%1$s\'', pg_escape_string($connection, $replacement));

Replace
return sprintf('\'%1$s\'', pg_escape_string($replacement));

Second and third errors: You need to set the path to your cache directory in Settings.php.
Michael Eshom
Christian Metal Fans

Advertisement: