EXEC() [英] exec()

查看:60
本文介绍了EXEC()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我:


在PHP中使用exec()函数我可以执行linux程序,如ls,谁

和其他,但是我可以不执行C程序,我真的不知道

为什么。


请帮助我,

彼得

can anyone help me:

using exec() function in PHP i can execute linux programms like ls,who
and other, however i can not execute C programms and i really don''t know
why.

Please help me,
Peter

推荐答案

Piotr Wolski写道:
Piotr Wolski wrote:
任何人都可以帮助我:

使用exec( )PHP中的函数我可以执行像ls,
和其他的linux程序,但是我不能执行C程序,我真的不知道为什么。

请帮助我,
彼得
can anyone help me:

using exec() function in PHP i can execute linux programms like ls,who
and other, however i can not execute C programms and i really don''t know
why.

Please help me,
Peter




你认为ls,who和其他人是怎么写的?你在尝试做什么

呢?网络服务器用户是否可以访问所说的c。程序?你有文件上设置的

正确的权限吗?什么OS?该程序是否采用参数,如果

所以,请向我们展示如何执行它们的代码。您是否仔细阅读了文件

并看到了那里给出的例子?

-

Michael Austin。

顾问 - 可用。

欢迎捐款。 Http://www.firstdbasource.com/donations.html

:)



what do you think ls, who, and others are written in?? What are you trying do
do? does the webserver user have access to said "c" program? do you have the
correct privs set on the files? What OS? does the program take parameters, if
so, show us the code of how you are executing them. Have you read the docs
carefully and seen the examples given there??
--
Michael Austin.
Consultant - Available.
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)


2004年7月12日星期一13:49:21 -0500,Piotr Wolski< wo **** @ cs.purdue。 EDU>写道:
On Mon, 12 Jul 2004 13:49:21 -0500, Piotr Wolski <wo****@cs.purdue.edu> wrote:
任何人都可以帮助我:

在PHP中使用exec()函数我可以执行linux程序,如ls,谁
和其他,但是我无法执行C程序,我真的不知道为什么。
can anyone help me:

using exec() function in PHP i can execute linux programms like ls,who
and other, however i can not execute C programms and i really don''t know
why.




我也不会发布一些细节。 ''ls''和''who''都是C程序,而不是

它实际上与它们最初编写的内容相关。


赔率是某种权限问题。


-

Andy Hassall< an ** @ andyh.co.uk> / Space:磁盘使用情况分析工具
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space



Neither do I. Post some details. ''ls'' and ''who'' are both C programs, not that
it actually matters what they''re originally written in.

Odds are it''s a permissions problem of some sort.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space


Michael Austin写道:
Michael Austin wrote:
Piotr Wolski写道:
Piotr Wolski wrote:
任何人都可以帮助我:

在PHP中使用exec()函数我可以执行linux程序,比如ls,谁
和其他,但是我不能执行C程序,我真的不知道
知道为什么。

请帮助我,
彼得
can anyone help me:

using exec() function in PHP i can execute linux programms like ls,who
and other, however i can not execute C programms and i really don''t
know why.

Please help me,
Peter



您认为ls,who和其他人是什么?你在做什么呢?网络服务器用户是否可以访问所说的c。程序?
你有没有在文件上设置正确的权限?什么OS?
程序是否接受参数,如果是,请向我们展示您如何执行它们的代码。您是否仔细阅读了文档,并看到了那里给出的示例?


what do you think ls, who, and others are written in?? What are you
trying do do? does the webserver user have access to said "c" program?
do you have the correct privs set on the files? What OS? does the
program take parameters, if so, show us the code of how you are
executing them. Have you read the docs carefully and seen the examples
given there??




ok ls和其他用C语言编写但是它们包括在内作为系统

programms(命令)。编译我的C程序,从

命令行完美执行,但它们无法从Web执行。 unix系统。

如果程序采用或不采用参数并不重要。我是b / b
尝试写出几个字母的最简单的C程序。我甚至将
添加已编译的程序到PATH目录。结果是一样的..


我正在尝试这样做:

exec(" progs);

或passthru(progs);

即使我添加所有路径它也不会产生任何结果。

i尝试了exec(&#。 / progs 2> error_file");

当编译的程序位于脚本所在的目录中时,

error_file如下所示:

../progs:第1行的语法错误:''(''意外

到底是什么意思?

../progs从命令行执行了他应该做的很好..


请求帮助



ok ls and others are written in C however they are included as system
programms(commands). My C programms compiled ,executes perfectly from
command line, however they cannot be executed from the web. unix system.
it doesn''t matter if the programms takes or doesn''t take parameters. I''m
trying the simplest C programm that should write out few letters. i even
added compiled programm to the PATH directory. and the result is the same..

i''m trying to do so:
exec("progs");
or passthru("progs");
even when i add all the path it doesn''t take any result.
i tried exec("./progs 2> error_file");
when compiled programm is in the directory where the script is, then the
error_file looks like:
../progs: syntax error at line 1: ''('' unexpected
what the hell does it mean??
../progs exectuted from command line does what he should do very good..

please for help


这篇关于EXEC()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆