Solved

Weird SH error caused be broken PHP or bad programming ?

Posted on 2006-10-19
3
214 Views
Last Modified: 2006-11-26
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 !
0
Comment
Question by:Tiele
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 250 total points
ID: 17772681
Seems that you have ` ` commands in your script which are equal to system() so inbetween those ` ` there seem to be a " which is not closed. So the executed shell-command is not valid
The errors come from the shell not php. Do you have an error-handler which executes a shell-script (e.g. for logging, creating missing files ?)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question