Hello
I've got a simple Perl script that works fine from the command line but
not from PHP via the browser. It's a conversion program that converts
an image to a different format, and writes the new image to a
directory.
I'm running as user "nobody" and have the target directory set to
"nobody:nobody", and I've tried chmodding the directory to both 755 and
777 with no luck. If I run my script from the command line, it executes
with no problems. In PHP, I'm using
"system('/dir/to/file/convert.pl',$retval)", but the file doesn't get
created.
$retval returns a 0, so I'm assuming that's a good thing.
In my Perl script, I added a generic "print "Hello, World"" to it, and
$retval then returns "Hello World0", so I know the script is at least
doing something.
Any ideas on something I'm missing? Thanks for any help or pointing in
the right direction 3 1516
Hi,
Maybe stderr has additional info? Maybe this can get more info:
exec('/dir/to/file/convert.pl 2>&1', $output, $exitCode);
if ($exitCode != 0) {
trigger_error("Command failed with exit code $exitCode: \"" .
join("\n", $output) . "\".");
}
Acrobatic wrote:
Hello
I've got a simple Perl script that works fine from the command line but
not from PHP via the browser. It's a conversion program that converts
an image to a different format, and writes the new image to a
directory.
I'm running as user "nobody" and have the target directory set to
"nobody:nobody", and I've tried chmodding the directory to both 755 and
777 with no luck. If I run my script from the command line, it executes
with no problems. In PHP, I'm using
"system('/dir/to/file/convert.pl',$retval)", but the file doesn't get
created.
$retval returns a 0, so I'm assuming that's a good thing.
In my Perl script, I added a generic "print "Hello, World"" to it, and
$retval then returns "Hello World0", so I know the script is at least
doing something.
Any ideas on something I'm missing? Thanks for any help or pointing in
the right direction
Acrobatic wrote:
>
I've got a simple Perl script that works fine from the command line but
not from PHP via the browser. It's a conversion program that converts
an image to a different format, and writes the new image to a
directory.
Is your webserver chrooted?
Does your webserver user have permission to run the Perl executable?
Read the Perl source files?
Read the source images?
HTH
C.
Hello
Thanks very much for the response--I was unaware of the 2>&1 option and
it's really helped me debug this thing. It was a permissions issue, but
I wasn't able to figure that out without your help--thanks again
Jeff
petersprc wrote:
Hi,
Maybe stderr has additional info? Maybe this can get more info:
exec('/dir/to/file/convert.pl 2>&1', $output, $exitCode);
if ($exitCode != 0) {
trigger_error("Command failed with exit code $exitCode: \"" .
join("\n", $output) . "\".");
}
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: yawnmoth |
last post by:
i know that system commands can be run using the system("command")
function, but... some commands, such as mysqldump, require additional
input - input that can't be entered through the command...
|
by: melanieab |
last post by:
Hi,
I'm having a hard time understanding why some commands appear to be ignored
during an event.
I have a group of tabpages, and when one tabpage is left, I have a Focus
Leave event that captures...
|
by: Doogie |
last post by:
Hi,
I have a lot of old VB 6 experience and for the last several years
have been programming in C#. Now I'm going to be doing some VB.NET
development. As I'm "relearning" things so to speak, I...
|
by: pbd22 |
last post by:
Hi.
Anybody know of any good code examples out there on
how to take a telnet command and parse it?
Thanks!
|
by: Riccardo Maria Bianchi |
last post by:
Hello! :)
I'm trying to run shell commands both with os.system() and
subprocess.Popen() class.
But I can't run aliases or function defined in my .bashrc file, like in
the login interactive...
|
by: poolboi |
last post by:
hi guys,
a question on net::telnet
what does this module do?
cos i have a telnet client that will be able to communicate with a database
so is it true if i enter my ip address, username, and...
|
by: gert |
last post by:
This works but after the su command you have to wait like 2 minutes
before each command gets executed ?
What did i do wrong ?
import pxssh
try:
s = pxssh.pxssh()
s.login ('127.0.0.1',...
|
by: Greenwood |
last post by:
Hi all, I have a issue, a have a textbox which takes commands, the commands can be something like:
rp73{
rp36 {av 14, td 10} ,
td 35,
cc -1 1 -2
};
I have the code below so far and cant...
|
by: Chrisjc |
last post by:
Good evening,
I am trying to figure out a way where once I connect a removable hard drive with in the “Autorun.inf” file I would like it to do the following.
Check to see which “Server it is...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| | |