Drupal only powers part of our site. I've created a number of views that are intended to be used as reusable content (read: includes) on non-Drupal pages. For example, a list of recent recipes or videos published by Drupal.

For the most part, this works fine. When included on HTML pages via an Apache server side include (SSI), the content gets included without fail. However, when included on a PHP page, I get the following in the Apache error log:

PHP Warning: require_once(./includes/bootstrap.inc) [function.require-once]: failed to open stream: No such file or directory in /path/to/drupal/root/index.php on line 14

PHP Fatal error: require_once() [function.require]: Failed opening required './includes/bootstrap.inc' (include_path='.:/usr/share/pear:/usr/share/php') in /path/to/drupal/root/index.php on line 14

This occurs when the Drupal content is included directly via PHP's virtual() function. This also happens when the PHP page includes an HTML file via the virtual() function, which then includes the Drupal content via an Apache SSI.

I can workaround this by using file_get_contents() or cURL, but I'd like to know why this is happening and if there are other solutions.

Comments

nutellacrepe’s picture

Any other ideas? I thought somehow setting $content to be the returned file...