[support] Write a text into a page like a node

Earnie Boyd earnie at users.sourceforge.net
Wed Jan 9 13:31:37 UTC 2008


Quoting Davide Michel 'ZioBudda' Morelli <michel at ziobudda.net>:

>
> This is my simple code for bar/foo.php:
>
> <?
>
> require_once '../includes/bootstrap.inc';
> drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
>
> $page = "io sono la pagina";
> echo theme('page',$page);
>
> ?>
>
> And the php-error is :
>
> PHP Fatal error:  require_once() [<a
> href='function.require'>function.require</a>]: Failed opening required
> './includes/cache.inc' (include_path='/opt/www/newzb/:.:..') in
> /opt/www/newzb/includes/bootstrap.inc on line 895
>
> If I move foo.php from bar/ to / and changhe ../includes in ./includes
> all works.
>
> Where is my error ?
>

Bootstrap and all other Drupal includes are coded to be relative to the 
current directory.  You need to chdir('..') and then include 
./include/bootstrap.inc.

Earnie -- http://for-my-kids.com/
-- http://give-me-an-offer.com/



More information about the support mailing list