Forum

Thread tagged as: Problem, Error, Configuration

White screen of death from Perch generated pages.

I am building a site where the entire navigation structure will be put in place by the client. So I need Perch to generate all the page/sub-pages and output the navigation.

I can generate pages in Perch's admin as expected and my templates are outputting the results as expected on the front end.

However I get the white screen of death when I click on the links output by the navigation.

View source reveals the markup stops as it hits the ~~~<?php perch_pages_title(); ?>~~~

Currently I only have this on my localhost installation.

I have recently upgraded MAMP to work with OS X Yosemite, but cannot see any installation issues.

DIAGNOSTIC:

Perch: 2.8.6, PHP: 5.6.7, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO Server OS: Darwin, apache2handler Installed apps: content (2.8.6), assets (2.8.6), categories (2.8.6) App runtimes: <?php $apps_list = array( 'content', 'categories', ); PERCH_LOGINPATH: /mg/perch PERCH_PATH: /Users/jonbeveridge/Sites/mg/perch PERCH_CORE: /Users/jonbeveridge/Sites/mg/perch/core PERCH_RESFILEPATH: /Users/jonbeveridge/Sites/mg/perch/resources Image manipulation: GD PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M Resource folder writeable: Yes HTTP_HOST: localhost:8888 DOCUMENT_ROOT: /Users/jonbeveridge/Sites REQUEST_URI: /mg/perch/core/settings/diagnostics/ SCRIPT_NAME: /mg/perch/core/settings/diagnostics/index.php

The master page template is using the code as found in the 'detail / list view' solution in Perch Docs:

<?php include($_SERVER['DOCUMENT_ROOT'].'/perch/runtime.php'); ?>
<!doctype html>
<html class="no-js" lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title><?php perch_pages_title(); ?></title>
    <link href='https://fonts.googleapis.com/css?family=Palanquin|Open+Sans+Condensed:300' rel='stylesheet' type='text/css' />
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" />
    <link rel="stylesheet" href="../css/foundation.min.css" />
    <link rel="stylesheet" href="../css/jetmenu.css" />
    <link rel="stylesheet" href="../css/style.css" />
    <script src="../js/vendor/modernizr.js"></script>
  </head>
  <body>
<?php perch_layout('global.header'); ?>
<?php

     perch_content_create('Products', array(
          'template'  => 'product_detail.html',
          'multiple'  => true,
          'edit-mode' => 'listdetail',
     ));


     if (perch_get('s')) {

          // Detail mode
          perch_content_custom('Products', array(
               'template' => 'product_detail.html',
               'filter'   => 'slug',
               'match'    => 'eq',
               'value'    => perch_get('s'),
               'count'    => 1,
          )); 

     } else {

          // List mode
          perch_content_custom('Products', array(
               'template' => 'product_listing.html',
          )); 
     }

?>


<?php perch_layout('global.footer'); ?>
<?php PerchUtil::output_debug(); ?>
    <script src="../js/vendor/jquery.js"></script>
    <script src="../js/foundation/foundation.js"></script>
    <script src="../js/vendor/jetmenu.js"></script> 
    <script type="text/javascript">
     jQuery(document).ready(function() {
          $().jetmenu();
     });
</script>
  </body>
</html>

The Master Page references 'index.php' within the 'residential' sub-folder. This was set up following the pages tut int he swift migrations video.

Debug info from the referenced page (direct linking):

Debug Message
SELECT * FROM perch2_pages WHERE pagePath='/mg/residential/index.php' LIMIT 1
SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/mg/residential/index.php' LIMIT 1
SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-001', '000')
Using template: /templates/navigation/level1.html
Using template: /templates/navigation/level2.html
Using template: /templates/navigation/level3.html
SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/mg/residential/index.php' OR regionPage='*' ORDER BY regionPage DESC
SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Products' AND (regionPage='/mg/residential/index.php' OR regionPage='*')
SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=5 AND idx.itemRev=2)) AND ((idx.indexKey='slug' AND idx.indexValue='door')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID ORDER BY sortval ASC LIMIT 0, 1
Using template: /templates/content//product_detail.html

I notice the last line of the debug includes two forward-slashes back to back - could this be the issue?

Not sure how much more info I shoudl supply to help diagnose the issue, but can supply the nav template / layout code as well.

Thanks.

Jon Douglas-Beveridge

Jon Douglas-Beveridge 0 points

  • 6 years ago

A white screen is a PHP error, finding out the error will help diagnose the problem.

As your using MAMP you can find it here: /Applications/MAMP/logs/php_error.log

Thx Harrison,

I can see that it is failing to load files:

I think it's gettign confused about where the web root is.

I've always directed my Server root to my 'sites' folder and then developed each site in a subfolder without issue before.

Any advice appreciated...

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's best not to develop in a subfolder, as all your paths will be wrong when the site goes live.

Changing:

<?php include($_SERVER['DOCUMENT_ROOT'].'/perch/runtime.php'); ?>

to

<?php include($_SERVER['DOCUMENT_ROOT'].'/mg/perch/runtime.php'); ?>

fixed the issue, but I do see your point Drew.

Thanks for advice.