include files not being included

include files not being included

am 03.12.2007 18:57:30 von dave

Hello,
I'm running php 5.2.5 installed from ports on a FreeBSD machine with
apache2 as the webserver. I've got php set up properly, but it doesn't
include include files. If i do a phpinfo() in a file that works telling me
php file processing is working fine. Yet if i have something like for an
example:



Test of includes



The above should have been included.





and in test-include.php i have:

This is a test include

i get only the line:
The above should have been included.
I did not enter php mode in the test include file because of the ?> sygnifying i'm already in php mode, but i tried it anyway and that didn't
make a difference, either case the file was not included.
This was working previously with php4, i know about the global variables
not being allowed in php5, has anything else changed in regards to include
files?
Any suggestions welcome.
Thanks.
Dave.

Re: include files not being included

am 03.12.2007 18:59:34 von Good Man

"Dave" wrote in
news:4754438c$0$8683$4c368faf@roadrunner.com:

> Hello,
> I'm running php 5.2.5 installed from ports on a FreeBSD machine
> with
> apache2 as the webserver. I've got php set up properly, but it doesn't
> include include files. If i do a phpinfo() in a file that works
> telling me php file processing is working fine. Yet if i have
> something like for an example:
>
>
>
> Test of includes
>
>
>


>

The above should have been included.


>
>
>
> and in test-include.php i have:
>
> This is a test include

The script above should be include("test-include.php");

and 'test-include.php' should be:

echo "This is a test include.";
?>

Do you have error reporting off? It would be debugging easier if it
were on.

Re: include files not being included

am 03.12.2007 18:59:49 von luiheidsgoeroe

On Mon, 03 Dec 2007 18:57:30 +0100, Dave wrote:

> Hello,
> I'm running php 5.2.5 installed from ports on a FreeBSD machine with
> apache2 as the webserver. I've got php set up properly, but it doesn't
> include include files. If i do a phpinfo() in a file that works telling
> me
> php file processing is working fine. Yet if i have something like for an
> example:
>
>
>
> Test of includes
>
>
>


>

The above should have been included.


>
>
>
> and in test-include.php i have:
>
> This is a test include
>
> i get only the line:
> The above should have been included.
> I did not enter php mode in the test include file because of the > and
> ?> sygnifying i'm already in php mode, but i tried it anyway and that
> didn't
> make a difference, either case the file was not included.

The included file should have php tags.

> This was working previously with php4, i know about the global
> variables
> not being allowed in php5, has anything else changed in regards to
> include
> files?

short_open_tags are off by default (as they should be). Use of
--
Rik Wasmus

Re: include files not being included

am 03.12.2007 19:03:55 von luiheidsgoeroe

On Mon, 03 Dec 2007 18:59:34 +0100, Good Man wrote:
> "Dave" wrote in
> news:4754438c$0$8683$4c368faf@roadrunner.com:
>
>> Hello,
>> I'm running php 5.2.5 installed from ports on a FreeBSD machine
>> with
>> apache2 as the webserver. I've got php set up properly, but it doesn't
>> include include files. If i do a phpinfo() in a file that works
>> telling me php file processing is working fine. Yet if i have
>> something like for an example:
>>
>>
>>
>> Test of includes
>>
>>
>>


>>

The above should have been included.


>>
>>
>>
>> and in test-include.php i have:
>>
>> This is a test include
>
> The script above should be include("test-include.php");

Nope, the () are optional.

> and 'test-include.php' should be:
>
> > echo "This is a test include.";
> ?>

Well, it should have the tags (assuming there is PHP code there).
--
Rik Wasmus

Re: include files not being included

am 04.12.2007 02:26:42 von Martin Lemke

Dave schrieb:

>



include does not do any output.


Test this:

test-include.php:

$test="'test-include.php' has been included";
?>

Your test script:

include_once('test-include.php');

print "

$test

";
?>

If output of yout test script ist not:

'test-include.php' has been
included

, then test-include.php hast not been included, but I dont
think so.

Martin