0

On a relatively straightforward concrete5 website, I have the following code:

        $a = new Area('Full width');
        $a->display($c);

The second line is breaking the page, but I cannot work out why. If you comment it out the page is rendered (clearly without the content showing), with it the page is completely blank (nothing in the source at all).

There's nothing relevant in either the concrete5 log, or the php error log and I'm all out of ideas of how to find out what could have gone wrong (which I can only assume is a data issue as the rest of the website is fine).

I'm hoping someone may have experienced something similar with ideas on how to debug or diagnose this.

(this is not a duplicate of other more generic "php white screen of death" - I have followed these and they do not have the answer to this, probably more specific, question)

Paul
  • 9,149
  • 12
  • 61
  • 107
  • Possible duplicate of [PHP's white screen of death](https://stackoverflow.com/questions/1475297/phps-white-screen-of-death) – Chris Apr 25 '18 at 11:15
  • 1
    Have you tried to debug? – Alessandro.Vegna Apr 25 '18 at 11:22
  • what do you mean by debug? echo statements is the only way I know how to - and it's a core concrete5 set of code that I can't really touch – Paul Apr 25 '18 at 13:14
  • It's not a duplicate of that @Chris - the question is how to diagnose this, as that's one of hte articles I've actually followed and not found a single error – Paul Apr 25 '18 at 13:15
  • @Paul, have you read the duplicate I suggested? Diagnosing the cause of blank output from PHP is exactly what it's about. – Chris Apr 25 '18 at 13:23
  • @Chris Yes, as in my question "There's nothing relevant in either the concrete5 log, or the php error log" – Paul Apr 25 '18 at 13:30
  • Have you made sure to enable the output of all errors and warnings? Do you see requests being made in your web server logs? Anything interesting there? – Chris Apr 25 '18 at 13:31
  • @Paul: What kind of blocks do you have added to the area in question? – 1stthomas Apr 26 '18 at 09:41

2 Answers2

0

If you're on a newer version of C5 try without the $c as that's not necessary anymore and might cause a problem depending on your PHP settings.

Nour Akalay
  • 429
  • 3
  • 4
0

You shouldn't use the global $c anymore (you don't say what version) but set it explicitly:

$c = \Page::getCurrentPage();

Also, you can try this (view the source after page render):

// $a->display($c);    
echo '<!--<pre>'. print_r($c, 1). '</pre>-->';

You should also turn on debugging during development (Output error info & Show debug):

http://yoursite.com/index.php/dashboard/system/environment/debug

@Nour - I thought the $c should not be used with Global Areas only...