Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Very strange Apache error

Running commands that don't exist? HELP!

3:21 pm on Apr 28, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 29, 2002
votes: 0

Hi all,
I just decided to test a nice little script I'd written for Imagemagick (in PHP). Basically it resizes images and after a couple of initial problems last night, it was working. It worked up until 3am (GMT).

I awake this morning to find that Apache has died. I try to restart apache and get the following errors:-

sh: -c: line 1: `/usr/bin/mogrify -resize 90% /home/rewired/www/html/admin/scratch/temp/screen7_(1).jpg'
sh: -c: line 1: syntax error near unexpected token `('
sh: -c: line 1: `/usr/bin/mogrify -resize 90% /home/rewired/www/html/admin/scratch/temp/screen7_(1).jpg'
sh: -c: line 1: syntax error near unexpected token `('
sh: -c:

That code comes from my PHP script, which shouldn't be running. The image name indicates that this problem was caused the second time I used the script, and I've worked out the syntax error problem and fixed it.

The problem I have is that despite fixing, Apache still will not start and dies with that error. I've removed the PHP script, just in case it was running again. Still dies. I've recompiled and reinstalled PHP and Apache (version 1.3.27 of Apache, 4.3.1 of PHP) - it still dies. Rebooted a thousand times, still dies.

I assume that the sh: -c means that this command is running from the shell. The processlist shows nothing of any consequence or anything related. I even checked my httpd.conf to make sure that the command didn't find its way in there.

If anyone could help, I would be SO grateful. My site is still down because of this.

Thank you in advance

2:43 am on Apr 30, 2003 (gmt 0)

New User

10+ Year Member

joined:Feb 9, 2003
votes: 0

Hi KMxRetro,

What command are you using to start apache? If it's via a system startup script, you might want to try this:

apachectl start

Bit of a long shot, but it might help if there's something wrong with the script you would normally use. Also, what does it say in Apache's error log? Does it print the "sh -c" error to your terminal?