I'm in localhost (Windows platform) development mode right now before exporting to a live site.
I'm trying to create blocks (PHP Filter) which contain simple one liner php include code so that when the blocks are embedded into regions the remote HTML content is included in each region.
Here is an example of the one liner block code (PHP filter mode)
include("../sites/all/files/include_in_block/include_content.php");
I could paste the HTML directly into each block but I would prefer to keep this content in a repository which I can edit and then have the content included in the drupal site. I'm using Amaya to edit the repository before it is included.
Here is the error message I'm seeing in the region which should display the included HTML page
Warning: include(../sites/all/files/include_in_block/include_content.php): failed to open stream: No such file or directory in eval() (line 9 of C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\drupal-7.8\modules\php\php.module(74) : eval()'d code).
Warning: include(): Failed opening '../sites/all/files/include_in_block/include_content.php' for inclusion (include_path='.;C:\php\pear') in eval() (line 9 of C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\drupal-7.8\modules\php\php.module(74) : eval()'d code).
There is as yet no include_path set in php.ini ..
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
;
In php.ini above should I set the include_path to .. ".;'c:\Program Files\Apache Software Foundation\Apache2.2\htdocs\drupal-7.8\sites\all\files\include_in_block' " ? Or is there a shorter variable / path I can use?
Comments
I suspect your problem is the
I suspect your problem is the relative path, does
work?
Thanks .. it was that simple
Thanks .. it was that simple .. it's now working.
I now find it useful to edit / preview the embedded block content using Amaya.