Link to home
Start Free TrialLog in
Avatar of Tiele
Tiele

asked on

Weird SH error caused be broken PHP or bad programming ?

Hi,

Years back i have written a large project in PHP3 wich was my first really big project (took over a year to develop). It was meant as a OOP project but because the prep took too long we had to hurry and coding isn't always like it should be. Since then there have been some code adaptations and insertions. In April we had a server crash and had to move to a new server & installation.. with this came PHP 5.0.4. After i made some small changes everything was back up & running.  Till last sunday. Totally out of the blue i cannot build my pages anymore and i'm getting the same error over and over, each time by another piece of code.

The error occurs when building our pages, exectuting the script from shell.
Our pages get build kinda like this:

function OpenTemplate(template) {
  fetch template from database;
  exec(template);
}

Main template:
OpenTemplate(x);
some php code
OpenTemplate(y);
some html code
OpenTemplate(z);
etc...

template X:
OpenTemplate(a);
OpenTemplate(b);

and so on..

The error is:
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 2: syntax error: unexpected end of file

It occurs on multiple lines.. i.e. :
 - when using $_SERVER['HTTP_POST'] in the templates
 - executing some faulty code:
    $this->column    = array();
    $this->column[1]->category = array();
    $this->column[1]->total = 0;
It will give an error on ->category or ->total when one is disabled.. when both enabled for execution it will generate the error just once.

Please help !
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial