Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Weird SH error caused be broken PHP or bad programming ?

Posted on 2006-10-19
3
Medium Priority
?
218 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 1000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

609 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