Re: [PHP] Difficulties including scripts from another folder (apache2.2, PHP5, Vista)

2007-06-10 Thread Richard Lynch
On Sat, June 9, 2007 9:04 pm, Robert Cummings wrote:
> On Sun, 2007-06-10 at 01:02 +0100, brice wrote:
>> Thanks a lot guys!
>>
>> Eventually Richard hit on the issue:
>>
>> >require(".\foo.inc.php"); ?>#
>> >
>> >If you put .\ in there, then maybe PHP thinks you mean to NOT use
>> the
>> >include_path, but only the local directory?
>> >
>> >Take .\ out.
>>
>> it was the .\ that stopped it working. taking it out worked a treat!
>
> I never write any PHP code that relies on the include path. I hate
> magical crap like that :)

There is nothing magical about it.

And it's certainly better than the home-brew screwed-up messes you get
otherwise...

Maybe yours is better, but I've lost enough hair trying to "fix"
packages that have their include files in the web tree, and am not
willing to go down that path again.  I'd rather re-write than suffer
that.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Difficulties including scripts from another folder (apache2.2, PHP5, Vista)

2007-06-09 Thread Robert Cummings
On Sun, 2007-06-10 at 01:02 +0100, brice wrote:
> Thanks a lot guys!
> 
> Eventually Richard hit on the issue:
> 
> >require(".\foo.inc.php"); ?>#
> >
> >If you put .\ in there, then maybe PHP thinks you mean to NOT use the
> >include_path, but only the local directory?
> >
> >Take .\ out.
> 
> it was the .\ that stopped it working. taking it out worked a treat!

I never write any PHP code that relies on the include path. I hate
magical crap like that :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Difficulties including scripts from another folder (apache2.2, PHP5, Vista)

2007-06-09 Thread brice

Thanks a lot guys!

Eventually Richard hit on the issue:


require(".\foo.inc.php"); ?>#

If you put .\ in there, then maybe PHP thinks you mean to NOT use the
include_path, but only the local directory?

Take .\ out.


it was the .\ that stopped it working. taking it out worked a treat!

thanks again!

Brice


--
"Reality is that which, when you stop believing in it, doesn't go
away."-Philip K. Dick


Re: [PHP] Difficulties including scripts from another folder (apache2.2, PHP5, Vista)

2007-06-09 Thread Richard Lynch
On Thu, June 7, 2007 10:29 pm, brice wrote:
> I was wondering if anybody had any ideas about how to tackle this
> problem:
>
> I have just set up Apache2.2 and php5 on VISTA

There's your first problem.
[smirk]

> using mod_php. Php page
> load
> work fine for most things. However, when i try to separate some .php
> files
> for inclusion throughout the website in a separate folder to the
> visited
> pages, I get a non-verbose error which stops the php script working.
> the
> rest of the page (the html) looks fine, but the script doesn't do
> anything,
> and doesn't print an error message (i did NOT use @include, but
> include)

You may have set up php.ini correctly so error messages are logged
instead of displayed.

Check your Apache logs.

> the folders go like this:
>
> e:\httpdocs\php-bin\foo.inc.phpfile to be included
> e:\httpdocs\documents\index.phpfile doing the including
>
> where:
> -php.ini is loaded correctly in c:\windows\php.ini, as shown by
> phpinfo(),
> and where #include_path = ".;e:\httpdocs\php-bin"#
> -the call to foo.inc.php is in the head element of index.php as # require(".\foo.inc.php"); ?>#
> -the apache doc root is e:\httpdocs\

If you put .\ in there, then maybe PHP thinks you mean to NOT use the
include_path, but only the local directory?

Take .\ out.

>
> I have tried making sure that the include path was correct by using:
> #ini_set("include_path",
> "e:\httpdocs\php-bin");# as well as
> #set_include_path("e:\httpdocs\php-bin");#, but to no avail.

\ is a special character inside "" and while I don't think \h nor \p
are special, so it "works" I'd go with:
"E:\\httpdocs\\php-bin"

> the only way to make this work is by using this:
> #require("..\php-bin\foo.inc.php");# , but i shouldn't have to do that
> as i
> have set my include_path correctly ( i think). This will cause major
> headaches as the website grows, since each page will have to be
> customised
> for the level in the hierachy.

Definitely keep at it until you get include_path to work -- cuz you
are right about the major headache part if you don't.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Difficulties including scripts from another folder (apache2.2, PHP5, Vista)

2007-06-07 Thread Robert Cummings
On Fri, 2007-06-08 at 04:29 +0100, brice wrote:
> Hi,
> 
> I was wondering if anybody had any ideas about how to tackle this problem:
> 
> I have just set up Apache2.2 and php5 on VISTA using mod_php. Php page load
> work fine for most things. However, when i try to separate some .php files
> for inclusion throughout the website in a separate folder to the visited
> pages, I get a non-verbose error which stops the php script working. the
> rest of the page (the html) looks fine, but the script doesn't do anything,
> and doesn't print an error message (i did NOT use @include, but include)
> 
> the folders go like this:
> 
> e:\httpdocs\php-bin\foo.inc.phpfile to be included
> e:\httpdocs\documents\index.phpfile doing the including
> 
> where:
> -php.ini is loaded correctly in c:\windows\php.ini, as shown by phpinfo(),
> and where #include_path = ".;e:\httpdocs\php-bin"#
> -the call to foo.inc.php is in the head element of index.php as # require(".\foo.inc.php"); ?>#
> -the apache doc root is e:\httpdocs\
> 
> I have tried making sure that the include path was correct by using:
> #ini_set("include_path",
> "e:\httpdocs\php-bin");# as well as
> #set_include_path("e:\httpdocs\php-bin");#, but to no avail.
> 
> the only way to make this work is by using this:
> #require("..\php-bin\foo.inc.php");# , but i shouldn't have to do that as i
> have set my include_path correctly ( i think). This will cause major
> headaches as the website grows, since each page will have to be customised
> for the level in the hierachy.
> 
> any ideas why that is and how it could be solved?

Yes, learn to escape your backslashes. They are special characters when
using double quotes.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Difficulties including scripts from another folder (apache2.2, PHP5, Vista)

2007-06-07 Thread brice

Hi,

I was wondering if anybody had any ideas about how to tackle this problem:

I have just set up Apache2.2 and php5 on VISTA using mod_php. Php page load
work fine for most things. However, when i try to separate some .php files
for inclusion throughout the website in a separate folder to the visited
pages, I get a non-verbose error which stops the php script working. the
rest of the page (the html) looks fine, but the script doesn't do anything,
and doesn't print an error message (i did NOT use @include, but include)

the folders go like this:

e:\httpdocs\php-bin\foo.inc.phpfile to be included
e:\httpdocs\documents\index.phpfile doing the including

where:
-php.ini is loaded correctly in c:\windows\php.ini, as shown by phpinfo(),
and where #include_path = ".;e:\httpdocs\php-bin"#
-the call to foo.inc.php is in the head element of index.php as ##
-the apache doc root is e:\httpdocs\

I have tried making sure that the include path was correct by using:
#ini_set("include_path",
"e:\httpdocs\php-bin");# as well as
#set_include_path("e:\httpdocs\php-bin");#, but to no avail.

the only way to make this work is by using this:
#require("..\php-bin\foo.inc.php");# , but i shouldn't have to do that as i
have set my include_path correctly ( i think). This will cause major
headaches as the website grows, since each page will have to be customised
for the level in the hierachy.

any ideas why that is and how it could be solved?

brice