?
Solved

Error 127 when running command via exec

Posted on 2010-01-12
1
Medium Priority
?
808 Views
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?
0
Comment
Question by:SheppardDigital
1 Comment
 

Accepted Solution

by:
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.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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…
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.
Suggested Courses

621 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