Error 127 when running command via exec

Posted on 2010-01-12
Medium Priority
Last Modified: 2012-05-08
Hi All,

I'm trying to create a zip file through php using exec. However exec seems to be returned error 127.

I've tried echoing the command that's being ran, and pasted it into SSH, and the zip file is created fine.

The command being ran contains all the full paths to both zip and the files to be zipped.

I've check $PATH and the location of zip is included in it '/usr/bin'

I've tried chmoding zip to 777, and even tried changing the owner to nobody, but neither of those resolve the issue.

What's strange, is that on the same server we have another website using exactly the same method to zip files, and it works perfectly.

Here's an example of a command I'm trying to run

/usr/bin/zip -j /var/www/vhosts/somedomain.com/subdomains/library/httpdocs/admin/data/360_zzz.zip "/var/www/vhosts/somedomain.com/subdomains/library/httpdocs/admin/data/25_icon.png"

Can anyone shed any light on this issue?
Question by:SheppardDigital
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
1 Comment

Accepted Solution

SheppardDigital earned 0 total points
ID: 26296817
I have managed to resolve this problem, it turned out that safe_mode was ON for this site.

I had checked to make sure safe_mode was off in the php.ini file, however I didn't realise it had been set on a per site basis.

I logged into plesk and edited the settings for that domain, turning safe_mode off.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…
Suggested Courses

765 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