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

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

 



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.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\
> 
> 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


[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