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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.php        >>>>file to be included
> e:\httpdocs\documents\index.php    >>>>file 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 #<?php
> 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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux