Relative addressing issue.

Relative addressing issue.

am 21.09.2007 00:28:28 von AlterEgo

Hi all,

Win 2k3 server
Apache 2.0.59
PHP 5.2.4
Eclipse 3.3

I have been teaching myself open source web development utilizing a book
which I highly recommend for developers from other environments learning
XAMP web development: Core Web Application Development with PHP and MySQL.

I copied and modified some examples from the CD and have worked through most
of my issues so far. I'm stuck on a problem that I think is due to some
configuration item.

This is my web file structure relevant to the issue:

c:\web\tbwe\
c:\web\tbwe\error.php
c:\web\tbwe\includes\
c:\web\tbwe\includes\errors.php
c:\web\tbwe\images\
c:\web\tbwe\css\
c:\web\tbwe\logs\tbwe_log.log

In the "/includes" folder I have several files, among them is a file called
errors.php containing an error class. I get the following entries in the
Apache error log when I execute a page that calls the error function:

[Thu Sep 20 14:52:18 2007] [error] [client 127.0.0.1] PHP Warning:
error_log(../../logs/tbwe_log.log) [ href='function.error-log'>function.error-log]: failed to open stream: No
such file or directory in C:\\Web\\Tbwe\\includes\\errors.php on line 61
[Thu Sep 20 14:52:18 2007] [error] [client 127.0.0.1] script
'C:/Web/Tbwe/includes/error.php' not found or unable to stat
[Thu Sep 20 14:52:19 2007] [error] [client 127.0.0.1] script
'C:/Web/Tbwe/includes/error.php' not found or unable to stat
[Thu Sep 20 14:52:27 2007] [error] [client 127.0.0.1] script
'C:/Web/Tbwe/includes/error.php' not found or unable to stat

***First error:
Line 61 in the errors.php file:
error_log(date('c')
. " Unhandled Error ($in_errfile, $in_errline): "
. "$in_errno, '$in_errstr'\r\n", 3, LOGFILE_PATH);

My guess is that LOGFILE_PATH isn't set correctly which is set earlier as
follows:
define('LOGFILE_PATH', '../../logs/tbwe_log.log');

***Second error:
This error doesn't display a line number, but there is a call that
references *error.php* that displays an error page. The file is in the doc
root, it is not in the /includes/ folder where the application is looking
for it. This is the call:

header('Location: ../error.php?err=' . $in_errno);

*** Apache relevant configuration:

DocumentRoot "C:/Web/Tbwe"


Options Indexes FollowSymLinks
Options +Includes
Options +IncludesNoExec
AllowOverride Limit
Order allow,deny
Allow from all


*** PHP relevant configuration:

doc_root ="C:\Web\Tbwe"
include_path=".;C:\Program Files\PHP\pear"
include_path = ".;c:\Web\Tbwe"

Any help is greatly appreciated.

-- Bill

Re: Relative addressing issue.

am 21.09.2007 00:35:37 von AlterEgo

Correction, the following command:
header('Location: ../error.php?err=' . $in_errno
Should have been:
header('Location: error.php?err=' . $in_errno

Appending the ../ was just something I was trying. Thanks.


"AlterEgo" wrote in message
news:13f5suck21vtba9@corp.supernews.com...
> Hi all,
>
> Win 2k3 server
> Apache 2.0.59
> PHP 5.2.4
> Eclipse 3.3
>
> I have been teaching myself open source web development utilizing a book
> which I highly recommend for developers from other environments learning
> XAMP web development: Core Web Application Development with PHP and
> MySQL.
>
> I copied and modified some examples from the CD and have worked through
> most of my issues so far. I'm stuck on a problem that I think is due to
> some configuration item.
>
> This is my web file structure relevant to the issue:
>
> c:\web\tbwe\
> c:\web\tbwe\error.php
> c:\web\tbwe\includes\
> c:\web\tbwe\includes\errors.php
> c:\web\tbwe\images\
> c:\web\tbwe\css\
> c:\web\tbwe\logs\tbwe_log.log
>
> In the "/includes" folder I have several files, among them is a file
> called errors.php containing an error class. I get the following entries
> in the Apache error log when I execute a page that calls the error
> function:
>
> [Thu Sep 20 14:52:18 2007] [error] [client 127.0.0.1] PHP Warning:
> error_log(../../logs/tbwe_log.log) [ > href='function.error-log'>function.error-log]: failed to open stream:
> No such file or directory in C:\\Web\\Tbwe\\includes\\errors.php on line
> 61
> [Thu Sep 20 14:52:18 2007] [error] [client 127.0.0.1] script
> 'C:/Web/Tbwe/includes/error.php' not found or unable to stat
> [Thu Sep 20 14:52:19 2007] [error] [client 127.0.0.1] script
> 'C:/Web/Tbwe/includes/error.php' not found or unable to stat
> [Thu Sep 20 14:52:27 2007] [error] [client 127.0.0.1] script
> 'C:/Web/Tbwe/includes/error.php' not found or unable to stat
>
> ***First error:
> Line 61 in the errors.php file:
> error_log(date('c')
> . " Unhandled Error ($in_errfile, $in_errline): "
> . "$in_errno, '$in_errstr'\r\n", 3, LOGFILE_PATH);
>
> My guess is that LOGFILE_PATH isn't set correctly which is set earlier as
> follows:
> define('LOGFILE_PATH', '../../logs/tbwe_log.log');
>
> ***Second error:
> This error doesn't display a line number, but there is a call that
> references *error.php* that displays an error page. The file is in the doc
> root, it is not in the /includes/ folder where the application is looking
> for it. This is the call:
>
> header('Location: ../error.php?err=' . $in_errno);
>
> *** Apache relevant configuration:
>
> DocumentRoot "C:/Web/Tbwe"
>
>
> Options Indexes FollowSymLinks
> Options +Includes
> Options +IncludesNoExec
> AllowOverride Limit
> Order allow,deny
> Allow from all
>
>
> *** PHP relevant configuration:
>
> doc_root ="C:\Web\Tbwe"
> include_path=".;C:\Program Files\PHP\pear"
> include_path = ".;c:\Web\Tbwe"
>
> Any help is greatly appreciated.
>
> -- Bill
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

Re: Relative addressing issue.

am 21.09.2007 01:55:48 von Michael Fesser

..oO(AlterEgo)

>Correction, the following command:
> header('Location: ../error.php?err=' . $in_errno
>Should have been:
> header('Location: error.php?err=' . $in_errno
>
>Appending the ../ was just something I was trying. Thanks.

It's still wrong. The URL must be absolute.

Micha