Forum
No Perch content after move
I made a copy of a live site for development of a replacement site. All the Perch content is available in Admin, but it doesn't display on the site's webpages. The error msg is that perch/runtime.php failed to open. I've tried permutations of the path in the webpage including <?php include($_SERVER['DOCUMENT_ROOT'].'/perch/runtime.php'); ?> and various paths in config. I changed the path of the pages in Admin, so the pages are previewed but without Perch content. I also republished all content. But none of these solved it.
Summary information
Perch: 2.8.34, PHP: 5.4.45, MySQL: 5.6.41-84.1, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34), perch_gallery (2.8.6)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_gallery', );
PERCH_LOGINPATH: /~infrarg5/iis/perch
PERCH_PATH: /home1/infrarg5/public_html/iis/perch
PERCH_CORE: /home1/infrarg5/public_html/iis/perch/core
PERCH_RESFILEPATH: /home1/infrarg5/public_html/iis/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 64M, Max POST 64M, Memory: 256M, Total max file upload: 64M
F1: 6a33f95eca3667f9e0c39bf5ca2980fe
Resource folder writeable: Yes
DOCUMENT_ROOT: /usr/local/apache/htdocs
HTTP_HOST: 50.87.249.68
REQUEST_URI: /~infrarg5/iis/perch/core/settings/diagnostics/
SCRIPT_NAME: /~infrarg5/iis/perch/core/settings/diagnostics/index.php
(
[type] => 2
[message] => include(): Failed opening '/usr/local/apache/htdocs/perch/runtime.php' for inclusion (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear')
[file] => /home1/infrarg5/public_html/iis/infrared-roof-inspection.php
[line] => 2
)
Hi, it looks like your site may be in a subfolder
iis
. If Perch is expecting your pages/files to be in the root of the server, it will struggle to display the pages.Thanks for the response, Simon. Yes, pages/files are in a subdirectory 'iis'. But if Admin can display the content and knows where the pages are, then one would think there is a path setting that would enable/cause the content to be displayed on a webpage.
Perch serves up the content depending on which page is requesting it.
For example if Perch Admin has content for a page at
[root]/about-us/index.php
, but the the page requesting it is[root]/iis/about-us/index.php
perch will see it as a different page an not have any content to serve.If in Admin you go to a particular page and click on the 'Page Options' tab, what is the 'Path'?
I had already changed it from [page] to [iis/page], which shows the page but without the Perch content.
If you turn on debug, what does it output at the bottom of the page that isn't working?
There is no debug at teh bottom of the page. This is at the top:
Debug Message
Array ( [type] => 2 [message] => include(): Failed opening '/usr/local/apache/htdocs/perch/runtime.php' for inclusion (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') [file] => /home1/infrarg5/public_html/iis/infrared-roof-inspection.php [line] => 2 )
Ok. You should fix the include at the top of the page. Make sure the path reflects your new location.
I moved debug to the footer:
Debug Message
Array ( [type] => 2 [message] => include(): Failed opening '/usr/local/apache/htdocs/perch/runtime.php' for inclusion (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') [file] => /home1/infrarg5/public_html/iis/infrared-roof-inspection.php [line] => 2 )
[1] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/~infrarg5/iis/infrared-roof-inspection.php' OR regionPage='*' ORDER BY regionPage DESC
Array ( [type] => 2 [message] => include(): Failed opening '/usr/local/apache/htdocs/perch/runtime.php' for inclusion (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') [file] => /home1/infrarg5/public_html/iis/infrared-roof-inspection.php [line] => 2 )
It seems to be a configuration issue. My runtime include is <?php include('perch/runtime.php'); ?>. If I change it to anything else (even with a leading '/'), I lose the debug message. I've also tried <?php include($_SERVER['DOCUMENT_ROOT'].'/perch/runtime.php'); ?>
Drew, I changed the path in page options and now have my Perch text (but without images that came from resources), but I still have the same debug message.
Which debug message?
Debug message: failed to open runtime. Also, if I resave the Perch text for the page, Perch creates a new region rather than modifying the region I edited.
That's baffling as you can't get that output and the error message unless Perch is already running on the page, which only happens when the runtime has been include successfully.
Yes, that's why I thought it might be a configuration issue. Perch path and Perch login path seem to be ok, but content is confused, and then there's that runtime error. Is it possible that the initial runtime include is ok but something changes the setting during execution of the page? Doesn't seem possible since the only php commands are 3 includes of html files and a perch_content textarea.