Thread tagged as: Question, Discussion

Runway parse error question

I just had this exact same error occur:, AKA: Parse error: syntax error, unexpected end of file in /[path to]/config/config.production.php on line 1

I fixed it using Drew's fix from that linked thread—thanks!—but I'm really curious about what caused it? No rush since it's solved, I'd just like to know.

(In my case, the error occured when I changed the DNS A-record to point from a new domain to an existing IP.)

Lindsay Masten

Lindsay Masten 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It's hard to say without seeing the file. Do you have a copy of the file that caused the error?

Hi Drew,

The file that caused the error was the config.production.php file, same as the linked forum post, and all it is, is <?php.

That's part of why I'm curious... doesn't seem like something that would have been affected by a DNS change. Like I said, it was fixed by basically (some file path differences) doing what you suggested then, which was this:

Drew McLellan said:

Let's simplify it. Remove this part:

switch($_SERVER['SERVER_NAME']) {

case '': include(DIR.'/config.addtothenoise-com.php'); break;

default: include('config.production.php'); break; } and put this in its place:


Drew McLellan

Drew McLellan 2638 points
Perch Support

The error is a syntax error. It would have been the case for that user that the most pragmatic thing for them in the circumstance was to replace a bunch of code they didn't necessarily understand with something simpler.

I can't say what the case is with your site because I can't see it.