Subject: Re: Path-ralated problem while setting up a local postgresql website

From: "Magnus Hagander" <[email-masked]>
Date: Tue, 10 Jan 2006 22:57:14 +0100

> I modified in handler.php the line :
> 
>     require_once './global/settings.php'; to
>     require_once '/home/am/pgweb/portal/global/settings.php';
> 
> The error disappears, but it complains about the next require_once.
> 
> This is probably a configuration issue.
> Any ideas about what can be done to fix the problem?
> (it is very ugly to modify all the php files to use full paths ... )

In the .htaccess file in the root (portal) directory, I have:
php_value include_path "/var/www/pg-pear/lib:."

Do you have that, or similar? Note the single-dot path at the end after
the colon, it needs to be there.
And if it's there, are you sure it's being processed (the htaccess
itself, but also this line in particular)? Also worth double-checking.

//Magnus

---

From: Adrian Maier <[email-masked]>
Date: Wed, 11 Jan 2006 00:10:39 +0200

> itself, but also this line in particular)? Also worth double-checking.

Hello,

In .htaccess i have :
    php_value include_path "/usr/pkg/lib/php/:."
The setting is surely processed because the error message displays
the include_path .

Anyway, I have read the user comments for php's  include
and found a solution:
The problem is solved by adding at the beginning of handler.php :
         chdir(realpath(dirname(__FILE__)));

Thanks for the reply,
Adrian Maier

---

From: Adrian Maier <[email-masked]>
Date: Sat, 14 Jan 2006 20:32:25 +0200

>          chdir(realpath(dirname(__FILE__)));

Hello again guys,

After finding the solution described above, i stumbled across another problem:

Apparently randomly some pages of the website fail to load, generating the
following errors:

[Sat Jan 14 23:40:09 2006] [error] [client 82.76.xxx.xx] PHP Notice: 
Constant MAX_OPTIONS already defined in
/home/am/pgweb/portal/system/global/settings.php on line 21, referer:
http://pgsql.newsoftcontrol.ro:8888/
[Sat Jan 14 23:40:09 2006] [error] [client 82.76.xxx.xx1] PHP Notice: 
Constant MIRROR_CELLS already defined in
/home/am/pgweb/portal/system/global/settings.php on line 24, referer:
http://pgsql.newsoftcontrol.ro:8888/
[Sat Jan 14 23:40:09 2006] [error] [client 82.76.xxx.xx] PHP Notice: 
Constant DEBUG already defined in
/home/am/pgweb/portal/system/global/settings.php on line 27, referer:
http://pgsql.newsoftcontrol.ro:8888/
[Sat Jan 14 23:40:09 2006] [error] [client 82.76.xxx.xx] PHP Fatal
error:  Cannot redeclare database_connect() (previously declared in
/home/am/pgweb/portal/system/global/functions.database.php:13) in
/home/am/pgweb/portal/system/global/functions.database.php on line 13,
referer: http://pgsql.newsoftcontrol.ro:8888/

Sometimes,  if i click "refresh"  several times the page finally gets loaded.
What could be done to avoid this problem ?

Best wishes,
Adrian Maier