Re: [PHP] Nested include/require not working in 5.2 (SOLVED)

2007-11-28 Thread Mike Yrabedra
on 11/27/07 3:49 PM, Wolf at [EMAIL PROTECTED] wrote:

> 
>  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
>> on 11/27/07 1:53 PM, Wolf at [EMAIL PROTECTED] wrote:
>> 
>>> 
>>>  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
 on 11/27/07 1:43 PM, Wolf at [EMAIL PROTECTED] wrote:
 
> 
>  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
>> on 11/27/07 11:46 AM, Jochem Maas at [EMAIL PROTECTED] wrote:
>> 
>>> Mike Yrabedra wrote:
 
 I am not able to use includes or requires in nested files using php
 5.2.3
 (osx)
 
 Including or Requiring files directly works.
 
 Including files, that also have includes in them, does not.
 
 Say you have this...
 
 -TopDirectory
 --index.php (contains include("includes/top.php"); )
 --includes (folder)
 ---config.php (contains echo "crap"; )
 ---top.php (contains include("config.php"); )
 
 When you load the index.php file you would expect the word "crap" to
 show,
 but it does not. I think the getcwd is staying specific to the top
 folder,
 so the path stays the same throughout.
 
 This does not happen in 5.1.6
>>> 
>>> nothing changed in php - the CWD has always been the dir in which the
>>> explicitly
>>> called script lives in and it does not change because your inside an
>>> included
>>> file.
>>> 
>>> my guess is your include_path no longer includes '.' so php is not
>>> trying
>>> to
>>> find the file
>>> in the directory of the script which is doing the include.
>>> 
 
 Is there a fix for this or is it PHP causing the problem?
 
 
>>> 
>> 
>> 
>> Here is what I have for include_path...
>> 
>> include_path = ".:/usr/local/pear"
>> 
>> Everything seems to be in order?
>> 
>> -- 
>> Mike Yrabedra B^)>
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> The first question I have is what does the Error log show?
> 
> You should have error reporting turned on so you can see where the script
> is
> barfing on the coding.
> 
> Wolf
 
 
 One more thing, it only does this IF the nested include file is named
 'config.php'.
 
 No error is thrown because it is pulling the 'config.php' file from
 somewhere, I just do not know where.
 
 If I change the name of the file from 'config.php' to 'config1.php', then
 everything works fine.
 
 Is there a way to figure out where and why it is pulling this mystery
 'config.php' file from?
 
 -- 
 Mike Yrabedra B^)>
>>> 
>>> What does the error message log tell you?  It should be readily available in
>>> it
>>> 
>>> Wolf
>> 
>> 
>> The include tag is not throwing any error.
>> 
>> If I call the same file with a read file method, then I get this error
>> 
>> Warning: readfile(config.php) [function.readfile]: failed to open stream: No
>> such file or directory in
>> 
>> Even though the file calling it is in the same directory as 'config.php'
>> 
> 
> Your include path should be along the lines of:
> include_path = ".:/usr/local/pear:/server/path/to/web/includes/folder"
> so if your server root is /var/htdocs/www it would look like:
> include_path = ".:/var/htdocs/www/includes:/usr/local/pear"
> 
> Notice that I changed the order to look local first, then go to the includes
> folder.
> 
> HTH,
> Wolf

Isn't it always the obvious thing that fixes things?? ;-)

Inside the '/usr/local/pear' was the pear 'Config.php' file.

PHP was not using the local version, but grabbing this one instead.

I have adjusted the include_path so that this will no longer happen.

Thanks to everyone that chimed in. :-)



-- 
Mike Yrabedra B^)>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested include/require not working in 5.2

2007-11-28 Thread news_yodpeirs
Did you look for files named config.php? I would try to find out which file 
is loaded instead of the wanted one. Maybe you could use 
fopen('config.php','r',TRUE); and check the contents of that file to get an 
idea where it comes from? If it happens only with a file of this name, I 
would assume that there is a file of this name somewhere in the include_path 
...

HTH, Thomas 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested include/require not working in 5.2

2007-11-27 Thread Mike Yrabedra
on 11/27/07 3:49 PM, Wolf at [EMAIL PROTECTED] wrote:

> 
>  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
>> on 11/27/07 1:53 PM, Wolf at [EMAIL PROTECTED] wrote:
>> 
>>> 
>>>  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
 on 11/27/07 1:43 PM, Wolf at [EMAIL PROTECTED] wrote:
 
> 
>  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
>> on 11/27/07 11:46 AM, Jochem Maas at [EMAIL PROTECTED] wrote:
>> 
>>> Mike Yrabedra wrote:
 
 I am not able to use includes or requires in nested files using php
 5.2.3
 (osx)
 
 Including or Requiring files directly works.
 
 Including files, that also have includes in them, does not.
 
 Say you have this...
 
 -TopDirectory
 --index.php (contains include("includes/top.php"); )
 --includes (folder)
 ---config.php (contains echo "crap"; )
 ---top.php (contains include("config.php"); )
 
 When you load the index.php file you would expect the word "crap" to
 show,
 but it does not. I think the getcwd is staying specific to the top
 folder,
 so the path stays the same throughout.
 
 This does not happen in 5.1.6
>>> 
>>> nothing changed in php - the CWD has always been the dir in which the
>>> explicitly
>>> called script lives in and it does not change because your inside an
>>> included
>>> file.
>>> 
>>> my guess is your include_path no longer includes '.' so php is not
>>> trying
>>> to
>>> find the file
>>> in the directory of the script which is doing the include.
>>> 
 
 Is there a fix for this or is it PHP causing the problem?
 
 
>>> 
>> 
>> 
>> Here is what I have for include_path...
>> 
>> include_path = ".:/usr/local/pear"
>> 
>> Everything seems to be in order?
>> 
>> -- 
>> Mike Yrabedra B^)>
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> The first question I have is what does the Error log show?
> 
> You should have error reporting turned on so you can see where the script
> is
> barfing on the coding.
> 
> Wolf
 
 
 One more thing, it only does this IF the nested include file is named
 'config.php'.
 
 No error is thrown because it is pulling the 'config.php' file from
 somewhere, I just do not know where.
 
 If I change the name of the file from 'config.php' to 'config1.php', then
 everything works fine.
 
 Is there a way to figure out where and why it is pulling this mystery
 'config.php' file from?
 
 -- 
 Mike Yrabedra B^)>
>>> 
>>> What does the error message log tell you?  It should be readily available in
>>> it
>>> 
>>> Wolf
>> 
>> 
>> The include tag is not throwing any error.
>> 
>> If I call the same file with a read file method, then I get this error
>> 
>> Warning: readfile(config.php) [function.readfile]: failed to open stream: No
>> such file or directory in
>> 
>> Even though the file calling it is in the same directory as 'config.php'
>> 
> 
> Your include path should be along the lines of:
> include_path = ".:/usr/local/pear:/server/path/to/web/includes/folder"
> so if your server root is /var/htdocs/www it would look like:
> include_path = ".:/var/htdocs/www/includes:/usr/local/pear"
> 
> Notice that I changed the order to look local first, then go to the includes
> folder.
> 
> HTH,
> Wolf


I will give this a try, but what happened from 5.1.6 -> 5.2.3 that forces me
to do this?

All the php.ini settings are the same, but I have this problem only on
5.2.3 with files named 'config.php'. That is the really weird part.


-- 
Mike Yrabedra B^)>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested include/require not working in 5.2

2007-11-27 Thread Wolf

 Mike Yrabedra <[EMAIL PROTECTED]> wrote: 
> on 11/27/07 1:53 PM, Wolf at [EMAIL PROTECTED] wrote:
> 
> > 
> >  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
> >> on 11/27/07 1:43 PM, Wolf at [EMAIL PROTECTED] wrote:
> >> 
> >>> 
> >>>  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
>  on 11/27/07 11:46 AM, Jochem Maas at [EMAIL PROTECTED] wrote:
>  
> > Mike Yrabedra wrote:
> >> 
> >> I am not able to use includes or requires in nested files using php 
> >> 5.2.3
> >> (osx)
> >> 
> >> Including or Requiring files directly works.
> >> 
> >> Including files, that also have includes in them, does not.
> >> 
> >> Say you have this...
> >> 
> >> -TopDirectory
> >> --index.php (contains include("includes/top.php"); )
> >> --includes (folder)
> >> ---config.php (contains echo "crap"; )
> >> ---top.php (contains include("config.php"); )
> >> 
> >> When you load the index.php file you would expect the word "crap" to
> >> show,
> >> but it does not. I think the getcwd is staying specific to the top
> >> folder,
> >> so the path stays the same throughout.
> >> 
> >> This does not happen in 5.1.6
> > 
> > nothing changed in php - the CWD has always been the dir in which the
> > explicitly
> > called script lives in and it does not change because your inside an
> > included
> > file.
> > 
> > my guess is your include_path no longer includes '.' so php is not 
> > trying
> > to
> > find the file
> > in the directory of the script which is doing the include.
> > 
> >> 
> >> Is there a fix for this or is it PHP causing the problem?
> >> 
> >> 
> > 
>  
>  
>  Here is what I have for include_path...
>  
>  include_path = ".:/usr/local/pear"
>  
>  Everything seems to be in order?
>  
>  -- 
>  Mike Yrabedra B^)>
>  
>  -- 
>  PHP General Mailing List (http://www.php.net/)
>  To unsubscribe, visit: http://www.php.net/unsub.php
> >>> 
> >>> The first question I have is what does the Error log show?
> >>> 
> >>> You should have error reporting turned on so you can see where the script 
> >>> is
> >>> barfing on the coding.
> >>> 
> >>> Wolf
> >> 
> >> 
> >> One more thing, it only does this IF the nested include file is named
> >> 'config.php'.
> >> 
> >> No error is thrown because it is pulling the 'config.php' file from
> >> somewhere, I just do not know where.
> >> 
> >> If I change the name of the file from 'config.php' to 'config1.php', then
> >> everything works fine.
> >> 
> >> Is there a way to figure out where and why it is pulling this mystery
> >> 'config.php' file from?
> >> 
> >> -- 
> >> Mike Yrabedra B^)>
> > 
> > What does the error message log tell you?  It should be readily available in
> > it
> > 
> > Wolf
> 
> 
> The include tag is not throwing any error.
> 
> If I call the same file with a read file method, then I get this error
> 
> Warning: readfile(config.php) [function.readfile]: failed to open stream: No
> such file or directory in
> 
> Even though the file calling it is in the same directory as 'config.php'
> 

Your include path should be along the lines of:
include_path = ".:/usr/local/pear:/server/path/to/web/includes/folder"
so if your server root is /var/htdocs/www it would look like:
include_path = ".:/var/htdocs/www/includes:/usr/local/pear"

Notice that I changed the order to look local first, then go to the includes 
folder.

HTH,
Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested include/require not working in 5.2

2007-11-27 Thread Stut

Mike Yrabedra wrote:

on 11/27/07 1:53 PM, Wolf at [EMAIL PROTECTED] wrote:


 Mike Yrabedra <[EMAIL PROTECTED]> wrote:

on 11/27/07 1:43 PM, Wolf at [EMAIL PROTECTED] wrote:


 Mike Yrabedra <[EMAIL PROTECTED]> wrote:

on 11/27/07 11:46 AM, Jochem Maas at [EMAIL PROTECTED] wrote:


Mike Yrabedra wrote:

I am not able to use includes or requires in nested files using php 5.2.3
(osx)

Including or Requiring files directly works.

Including files, that also have includes in them, does not.

Say you have this...

-TopDirectory
--index.php (contains include("includes/top.php"); )
--includes (folder)
---config.php (contains echo "crap"; )
---top.php (contains include("config.php"); )

When you load the index.php file you would expect the word "crap" to
show,
but it does not. I think the getcwd is staying specific to the top
folder,
so the path stays the same throughout.

This does not happen in 5.1.6

nothing changed in php - the CWD has always been the dir in which the
explicitly
called script lives in and it does not change because your inside an
included
file.

my guess is your include_path no longer includes '.' so php is not trying
to
find the file
in the directory of the script which is doing the include.


Is there a fix for this or is it PHP causing the problem?




Here is what I have for include_path...

include_path = ".:/usr/local/pear"

Everything seems to be in order?

--
Mike Yrabedra B^)>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

The first question I have is what does the Error log show?

You should have error reporting turned on so you can see where the script is
barfing on the coding.

Wolf


One more thing, it only does this IF the nested include file is named
'config.php'.

No error is thrown because it is pulling the 'config.php' file from
somewhere, I just do not know where.

If I change the name of the file from 'config.php' to 'config1.php', then
everything works fine.

Is there a way to figure out where and why it is pulling this mystery
'config.php' file from?

--
Mike Yrabedra B^)>

What does the error message log tell you?  It should be readily available in
it

Wolf



The include tag is not throwing any error.

If I call the same file with a read file method, then I get this error

Warning: readfile(config.php) [function.readfile]: failed to open stream: No
such file or directory in

Even though the file calling it is in the same directory as 'config.php'


Jochem was nearly right in an earlier reply. The CWD is usually set to 
the directory that contains the initial script. It does not change when 
you include a file. This affects include, require and file functions.


If you want to reference a file relative to the current script 
regardless of what the CWD is, use dirname(__FILE__) to prefix the 
script. For example...


include dirname(__FILE__).'/config.php';

There are other ways to handle this. The one I tend to use is to change 
include_path to contain the root directory for your scripts. That way 
you can reference all include files as relative to that directory 
without worrying about where the initial script is/was.


-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested include/require not working in 5.2

2007-11-27 Thread Mike Yrabedra
on 11/27/07 1:53 PM, Wolf at [EMAIL PROTECTED] wrote:

> 
>  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
>> on 11/27/07 1:43 PM, Wolf at [EMAIL PROTECTED] wrote:
>> 
>>> 
>>>  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
 on 11/27/07 11:46 AM, Jochem Maas at [EMAIL PROTECTED] wrote:
 
> Mike Yrabedra wrote:
>> 
>> I am not able to use includes or requires in nested files using php 5.2.3
>> (osx)
>> 
>> Including or Requiring files directly works.
>> 
>> Including files, that also have includes in them, does not.
>> 
>> Say you have this...
>> 
>> -TopDirectory
>> --index.php (contains include("includes/top.php"); )
>> --includes (folder)
>> ---config.php (contains echo "crap"; )
>> ---top.php (contains include("config.php"); )
>> 
>> When you load the index.php file you would expect the word "crap" to
>> show,
>> but it does not. I think the getcwd is staying specific to the top
>> folder,
>> so the path stays the same throughout.
>> 
>> This does not happen in 5.1.6
> 
> nothing changed in php - the CWD has always been the dir in which the
> explicitly
> called script lives in and it does not change because your inside an
> included
> file.
> 
> my guess is your include_path no longer includes '.' so php is not trying
> to
> find the file
> in the directory of the script which is doing the include.
> 
>> 
>> Is there a fix for this or is it PHP causing the problem?
>> 
>> 
> 
 
 
 Here is what I have for include_path...
 
 include_path = ".:/usr/local/pear"
 
 Everything seems to be in order?
 
 -- 
 Mike Yrabedra B^)>
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
>>> 
>>> The first question I have is what does the Error log show?
>>> 
>>> You should have error reporting turned on so you can see where the script is
>>> barfing on the coding.
>>> 
>>> Wolf
>> 
>> 
>> One more thing, it only does this IF the nested include file is named
>> 'config.php'.
>> 
>> No error is thrown because it is pulling the 'config.php' file from
>> somewhere, I just do not know where.
>> 
>> If I change the name of the file from 'config.php' to 'config1.php', then
>> everything works fine.
>> 
>> Is there a way to figure out where and why it is pulling this mystery
>> 'config.php' file from?
>> 
>> -- 
>> Mike Yrabedra B^)>
> 
> What does the error message log tell you?  It should be readily available in
> it
> 
> Wolf


The include tag is not throwing any error.

If I call the same file with a read file method, then I get this error

Warning: readfile(config.php) [function.readfile]: failed to open stream: No
such file or directory in

Even though the file calling it is in the same directory as 'config.php'



-- 
Mike Yrabedra B^)>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested include/require not working in 5.2

2007-11-27 Thread Wolf

 Mike Yrabedra <[EMAIL PROTECTED]> wrote: 
> on 11/27/07 1:43 PM, Wolf at [EMAIL PROTECTED] wrote:
> 
> > 
> >  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
> >> on 11/27/07 11:46 AM, Jochem Maas at [EMAIL PROTECTED] wrote:
> >> 
> >>> Mike Yrabedra wrote:
>  
>  I am not able to use includes or requires in nested files using php 5.2.3
>  (osx)
>  
>  Including or Requiring files directly works.
>  
>  Including files, that also have includes in them, does not.
>  
>  Say you have this...
>  
>  -TopDirectory
>  --index.php (contains include("includes/top.php"); )
>  --includes (folder)
>  ---config.php (contains echo "crap"; )
>  ---top.php (contains include("config.php"); )
>  
>  When you load the index.php file you would expect the word "crap" to 
>  show,
>  but it does not. I think the getcwd is staying specific to the top 
>  folder,
>  so the path stays the same throughout.
>  
>  This does not happen in 5.1.6
> >>> 
> >>> nothing changed in php - the CWD has always been the dir in which the
> >>> explicitly
> >>> called script lives in and it does not change because your inside an
> >>> included
> >>> file.
> >>> 
> >>> my guess is your include_path no longer includes '.' so php is not trying 
> >>> to
> >>> find the file
> >>> in the directory of the script which is doing the include.
> >>> 
>  
>  Is there a fix for this or is it PHP causing the problem?
>  
>  
> >>> 
> >> 
> >> 
> >> Here is what I have for include_path...
> >> 
> >> include_path = ".:/usr/local/pear"
> >> 
> >> Everything seems to be in order?
> >> 
> >> -- 
> >> Mike Yrabedra B^)>
> >> 
> >> -- 
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > The first question I have is what does the Error log show?
> > 
> > You should have error reporting turned on so you can see where the script is
> > barfing on the coding.
> > 
> > Wolf
> 
> 
> One more thing, it only does this IF the nested include file is named
> 'config.php'.
> 
> No error is thrown because it is pulling the 'config.php' file from
> somewhere, I just do not know where.
> 
> If I change the name of the file from 'config.php' to 'config1.php', then
> everything works fine.
> 
> Is there a way to figure out where and why it is pulling this mystery
> 'config.php' file from?
> 
> -- 
> Mike Yrabedra B^)>

What does the error message log tell you?  It should be readily available in 
it

Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested include/require not working in 5.2

2007-11-27 Thread Mike Yrabedra
on 11/27/07 1:43 PM, Wolf at [EMAIL PROTECTED] wrote:

> 
>  Mike Yrabedra <[EMAIL PROTECTED]> wrote:
>> on 11/27/07 11:46 AM, Jochem Maas at [EMAIL PROTECTED] wrote:
>> 
>>> Mike Yrabedra wrote:
 
 I am not able to use includes or requires in nested files using php 5.2.3
 (osx)
 
 Including or Requiring files directly works.
 
 Including files, that also have includes in them, does not.
 
 Say you have this...
 
 -TopDirectory
 --index.php (contains include("includes/top.php"); )
 --includes (folder)
 ---config.php (contains echo "crap"; )
 ---top.php (contains include("config.php"); )
 
 When you load the index.php file you would expect the word "crap" to show,
 but it does not. I think the getcwd is staying specific to the top folder,
 so the path stays the same throughout.
 
 This does not happen in 5.1.6
>>> 
>>> nothing changed in php - the CWD has always been the dir in which the
>>> explicitly
>>> called script lives in and it does not change because your inside an
>>> included
>>> file.
>>> 
>>> my guess is your include_path no longer includes '.' so php is not trying to
>>> find the file
>>> in the directory of the script which is doing the include.
>>> 
 
 Is there a fix for this or is it PHP causing the problem?
 
 
>>> 
>> 
>> 
>> Here is what I have for include_path...
>> 
>> include_path = ".:/usr/local/pear"
>> 
>> Everything seems to be in order?
>> 
>> -- 
>> Mike Yrabedra B^)>
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> The first question I have is what does the Error log show?
> 
> You should have error reporting turned on so you can see where the script is
> barfing on the coding.
> 
> Wolf


One more thing, it only does this IF the nested include file is named
'config.php'.

No error is thrown because it is pulling the 'config.php' file from
somewhere, I just do not know where.

If I change the name of the file from 'config.php' to 'config1.php', then
everything works fine.

Is there a way to figure out where and why it is pulling this mystery
'config.php' file from?


-- 
Mike Yrabedra B^)>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested include/require not working in 5.2

2007-11-27 Thread Wolf

 Mike Yrabedra <[EMAIL PROTECTED]> wrote: 
> on 11/27/07 11:46 AM, Jochem Maas at [EMAIL PROTECTED] wrote:
> 
> > Mike Yrabedra wrote:
> >> 
> >> I am not able to use includes or requires in nested files using php 5.2.3
> >> (osx)
> >> 
> >> Including or Requiring files directly works.
> >> 
> >> Including files, that also have includes in them, does not.
> >> 
> >> Say you have this...
> >> 
> >> -TopDirectory
> >> --index.php (contains include("includes/top.php"); )
> >> --includes (folder)
> >> ---config.php (contains echo "crap"; )
> >> ---top.php (contains include("config.php"); )
> >> 
> >> When you load the index.php file you would expect the word "crap" to show,
> >> but it does not. I think the getcwd is staying specific to the top folder,
> >> so the path stays the same throughout.
> >> 
> >> This does not happen in 5.1.6
> > 
> > nothing changed in php - the CWD has always been the dir in which the
> > explicitly
> > called script lives in and it does not change because your inside an 
> > included
> > file.
> > 
> > my guess is your include_path no longer includes '.' so php is not trying to
> > find the file
> > in the directory of the script which is doing the include.
> > 
> >> 
> >> Is there a fix for this or is it PHP causing the problem?
> >> 
> >> 
> > 
> 
> 
> Here is what I have for include_path...
> 
> include_path = ".:/usr/local/pear"
> 
> Everything seems to be in order?
> 
> -- 
> Mike Yrabedra B^)>
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

The first question I have is what does the Error log show?

You should have error reporting turned on so you can see where the script is 
barfing on the coding.

Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested include/require not working in 5.2

2007-11-27 Thread Mike Yrabedra
on 11/27/07 11:46 AM, Jochem Maas at [EMAIL PROTECTED] wrote:

> Mike Yrabedra wrote:
>> 
>> I am not able to use includes or requires in nested files using php 5.2.3
>> (osx)
>> 
>> Including or Requiring files directly works.
>> 
>> Including files, that also have includes in them, does not.
>> 
>> Say you have this...
>> 
>> -TopDirectory
>> --index.php (contains include("includes/top.php"); )
>> --includes (folder)
>> ---config.php (contains echo "crap"; )
>> ---top.php (contains include("config.php"); )
>> 
>> When you load the index.php file you would expect the word "crap" to show,
>> but it does not. I think the getcwd is staying specific to the top folder,
>> so the path stays the same throughout.
>> 
>> This does not happen in 5.1.6
> 
> nothing changed in php - the CWD has always been the dir in which the
> explicitly
> called script lives in and it does not change because your inside an included
> file.
> 
> my guess is your include_path no longer includes '.' so php is not trying to
> find the file
> in the directory of the script which is doing the include.
> 
>> 
>> Is there a fix for this or is it PHP causing the problem?
>> 
>> 
> 


Here is what I have for include_path...

include_path = ".:/usr/local/pear"

Everything seems to be in order?

-- 
Mike Yrabedra B^)>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested include/require not working in 5.2

2007-11-27 Thread Jochem Maas
Mike Yrabedra wrote:
> 
> I am not able to use includes or requires in nested files using php 5.2.3
> (osx)
> 
> Including or Requiring files directly works.
> 
> Including files, that also have includes in them, does not.
> 
> Say you have this...
> 
> -TopDirectory
> --index.php (contains include("includes/top.php"); )
> --includes (folder)
> ---config.php (contains echo "crap"; )
> ---top.php (contains include("config.php"); )
> 
> When you load the index.php file you would expect the word "crap" to show,
> but it does not. I think the getcwd is staying specific to the top folder,
> so the path stays the same throughout.
> 
> This does not happen in 5.1.6

nothing changed in php - the CWD has always been the dir in which the explicitly
called script lives in and it does not change because your inside an included 
file.

my guess is your include_path no longer includes '.' so php is not trying to 
find the file
in the directory of the script which is doing the include.

> 
> Is there a fix for this or is it PHP causing the problem?
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Nested include/require not working in 5.2

2007-11-27 Thread Mike Yrabedra


I am not able to use includes or requires in nested files using php 5.2.3
(osx)

Including or Requiring files directly works.

Including files, that also have includes in them, does not.

Say you have this...

-TopDirectory
--index.php (contains include("includes/top.php"); )
--includes (folder)
---config.php (contains echo "crap"; )
---top.php (contains include("config.php"); )

When you load the index.php file you would expect the word "crap" to show,
but it does not. I think the getcwd is staying specific to the top folder,
so the path stays the same throughout.

This does not happen in 5.1.6

Is there a fix for this or is it PHP causing the problem?


-- 
Mike Yrabedra B^)>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php