473,770 Members | 4,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

exec problem ?!?

Hello,
I am having some serious problems executing a command on my redhat linux
machine using exec, shell_exec, or any variants thereof.

I have a string saved into a variable like:

$mystring = "/usr/local/bin/lmc -e add /music/whatever.mp3";

Then I try to execute w/ something like:

$last_line = exec($mystring) ;
echo "{$last_lin e}";

This does absolutely nothing but when I run the same thing from the
command line it works fine. I also have made sure that it is not running
in safety_mode. The current user is nobody, but the program is accessable
to everyone. Any thoughts or places where I need ot provide more info?
Any suggestions to troubleshoot?

Brian

PS: this is driving me bonkers.
Jul 16 '05 #1
3 2680
try system() maybe?

--
Leslie

"rain" <de************ **@nc.rr.com> wrote in message
news:pa******** *************** *****@nc.rr.com ...
Hello,
I am having some serious problems executing a command on my redhat linux
machine using exec, shell_exec, or any variants thereof.

I have a string saved into a variable like:

$mystring = "/usr/local/bin/lmc -e add /music/whatever.mp3";

Then I try to execute w/ something like:

$last_line = exec($mystring) ;
echo "{$last_lin e}";

This does absolutely nothing but when I run the same thing from the
command line it works fine. I also have made sure that it is not running
in safety_mode. The current user is nobody, but the program is accessable
to everyone. Any thoughts or places where I need ot provide more info?
Any suggestions to troubleshoot?

Brian

PS: this is driving me bonkers.

Jul 16 '05 #2
On Sat, 26 Jul 2003 07:30:39 +0100, Leslie Hoare wrote:
try system() maybe?


I've tried w/ no success: system(), passthru(), fpassthru(), exec(), and
shell_exec().

Interestingly though I can't get any response from any of these commands.
Even when I execute a system command w/ one of the above funtions which
should return an error I receive nothin on a variable like $temp where the
code is:

$temp = exec("Code that will produce an error");

Any other thoughts

Thanks!
Jul 16 '05 #3
On Sat, 26 Jul 2003 08:36:08 GMT, "rain" <de************ **@nc.rr.com>
wrote:
On Sat, 26 Jul 2003 07:30:39 +0100, Leslie Hoare wrote:
try system() maybe?


I've tried w/ no success: system(), passthru(), fpassthru(), exec(), and
shell_exec() .

Interestingl y though I can't get any response from any of these commands.
Even when I execute a system command w/ one of the above funtions which
should return an error I receive nothin on a variable like $temp where the
code is:

$temp = exec("Code that will produce an error");

Any other thoughts


What return code are you getting? (See the third parameter to exec()
in the manual).

Andy Hassall (an**@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
8385
by: Hal Vaughan | last post by:
I have a script used to find and run Java on a Windows system.  It worked fine on original tests (on a Windows XP system).  It's now running on a Windows 2000 (sp3) system, and it won't work -- the problem is this line: set oCommand = WshShl.Exec(sCommand) (it's about halfway down)  Is there a problem with the Exec method in some versions of VBS?  Is the problem Windows version I'm on, or is it something more obvious that I'm just not...
1
2230
by: Andr? Roberge | last post by:
I have the following two files: #--testexec.py-- def exec_code(co): try: exec co except: print "error" #-- test.py--
0
10212
by: Jan | last post by:
I store sql-commands in a database table. In the first step I get the sql command out of the database table with embedded sql. In the second step I try to execute the command, which i got from the database table, using dynamic sql. Executing 'EXEC SQL DESCRIBE SELECT LIST FOR S INTO select_dp;' the error code -2149 is returned That means "Specified partition does not exist". Does anybody know if it is a database problem or a problem of
17
7925
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php" requires user input to run; this causes the TCL script calling the PHP script to hose up and die. Is there a way I can do this so that the TCL script can call the PHP
5
2436
by: TPJ | last post by:
I have the following code: ----------------------------------- def f(): def g(): a = 'a' # marked line 1 exec 'a = "b"' in globals(), locals() print "g: a =", a
4
2371
by: Michael | last post by:
Hi, I'm having difficulty finding any previous discussion on this -- I keep finding people either having problems calling os.exec(lepev), or with using python's exec statement. Neither of which I mean here. Just for a moment, let's just take one definition for one of the
21
7859
by: comp.lang.tcl | last post by:
set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts When I try this within TCL I get the following error:
2
3110
by: xml0x1a | last post by:
How do I use exec? Python 2.4.3 ---- from math import * G = 1 def d(): L = 1 exec "def f(x): return L + log(G) " in globals(), locals() f(1)
26
3663
by: warth33 | last post by:
Hello I have a php site. Some page needs to call an external program. The programs are home made c# applications. It uses to work without problem. For a while. Maybe it work for some hour. Or for a day. Or even for a week. At a certain point, when a php script calls the exe file, the application freezes. The following happens:
23
9388
by: Maarten | last post by:
Howdy, Recently I switched from a Windows PC to Mac OS-X 10.5 (php v5.2.6) and I have a little problem with one function within my cd-management script. For extracting a bit of info from my cd's I have an executable which I execute with exec(): $discOutput = exec('./discid /dev/rdisk2');
0
9595
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10232
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8891
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2822
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.