exec

exec() function doesn't rule svn checkout

Hi, I'm writing some functions in php using exec() to interrogate a svn. The commands exec("svn list ".$myurl) works. Now, I try to get a path on a svn repository with the checkout command. When I put the command "svn checkout http://core.wordress.org/tags/2.9.2/ last-version" directly in the console, it works. But when I do this fr...

Correct way to create a shell like environment in python?

I'm trying to create a shell like environment, where a user is presented with ">>>" and can type in any of a number of pre-defined commands. However, the only way I can think of implementing this is with a dictionary mapping commands->code and python's "exec". Is there a more correct way of doing this? ...

MSBuild Working with ItemGroup and EXEC Command

I created the ItemGroup shown in the code snippet. I need to iterate through this ItemGroup and run the EXEC command - also shown in the code snippet. I cannot seem to get it to work. The code returns the error shown below (note - the Message is written 2 times, which is correct), but the EXEC Command is not running correctly. The va...

Security of executing a command from php

I'm writing a web application in which i use several thirdy party commands calling them with the exec function in PHP (for example, I render Latex formulas through a command-line program). My question is: what are the security issues of executing external command-line programs in php? What I have to be aware of? Can you give me a list o...

shell_exec() and exec() Doesn't Show The Output

shell_exec(): I'm doing a PHP site that uses a shell_exec() function like this: $file = "upload/" . $_FILES["file"]["name"]; $output = shell_exec("leaf $file"); echo "<pre>$output</pre>"; Where leaf is a program that is located in the same directory of my script, but when I tried to run this script on the server, I just got nothing....

How to enable exec() in server?

Hi all, I dont know how to enable exec in server.Please help me ...

How to log the output from cmd tree command using Apache Ant exec task?

Hi, I am trying to log the output from cmd tree command using ant with the following: <exec dir="${basedir}" executable="cmd" output="output.txt"> <arg value="tree" /> </exec> However, I am seeing the following in the "output.txt": Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp...

javascript string exec strange behavior

have funciton in my object which is called regularly. parse : function(html) { var regexp = /...some pattern.../ var match = regexp.exec(html); while (match != null) { ... match = regexp.exec(html); } ... var r = /...pattern.../g; var m = r.exec(html); } with unchanged html the m returns...

Looking for an easy explanation of exec in PHP

I am having trouble understanding the exec function in PHP. Can someone please explain it to me in simple terms? ...

PHP : Understanding why exec($my_command) hang

Hi, I have an exec() call wich never end, and my Apache/PHP process is blocked until timeout. It's an PostgreSQL database load like that "C:\Program Files\PostgreSQL\8.3\bin"\psql --host 127.0.0.1 --dbname unitTests --file C:\ZendStd\www\voo4\trunk\resources\sql\base_test_projectx.pg.sql --username postgres 2>&1 It run fine in comma...

How to call a bash script from php passing parameters

I have a php script that execute a bash script. I try to pass parameters like this: $script="/opt/lampp/htdocs/adapt.sh" $file="/opt/lampp/htdocs/videos/video1.mp4" $prefix="Test" exec ('.$script.' '.$file.' '.$prefix.'); What's wrong? How can I pass the parameters? ...

SQL Strange Timeout Issue

Ok, so I am trying to create a procedure that call an extended procedure. I am getting the following error: Msg 121, Level 20, State 0, Line 0 A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.) Even with the simplest test I get tha...

PHP: How to know when exec() function is finish?

I have an exec function in php file that execs a bash script. It script calls fmpeg to transcode a video file. How can I know when transcoding is finish?? $script = "/opt/lamp../name.sh" exec("$script $videoIn $id") I will try using next code but it doesn't workd. if (exec("$script $videoIn $id")) { //print on screen that the vide...

file cretaed using exec could not be accessed immediately after creation?

HI I'm using exec in php to execute a command and it will create a .png file in a temp folder.. After creating that i'm trying to open that file and read contents and process them,, but i end up file could not read error.. I think the time taken by the exec to execute and create a file is the cause for the issue.. but i dont know ho...

Excuting Java JAR from PHP will not work

I have a java program that generates an HTML file. The Java program takes two input parameters: file1 and file2, the output file is specified by the "--file=". When executed from the command line (UNIX, Mac OS 10.6.2) it looks like this: "java -jar program.jar http://my.testsite.com/test1.html http://my.testsite.com/test2.html --file=...

call lynx from jsp script

Hi, I have an execute(String cmd) in a jsp script that calls the exec method from the Runtime class. It works when I call a local command, like a php script stored on the server. for example: /usr/bin/php /path/to/php/script arg1 arg2 So I guess my execute command is ok, since it is working with that. Now when I try to call lynx, the...

How to write java program to increase file limit using ulimit

I am using Fedora linux where ulimit -n 10000 increases file limit upto 10000. I want to achieve the same using java program How to write java program to increase file limit using ulimit I have tried with the below program but it didnot work well. The program didnot give any error. but didnot increase file limit also public class Incre...

Using nohup mysqldump from php script is inserting a '!' and breaking to a new line.

I'm trying to run a mysqldump from php using the nohup command to prevent the script from hanging. Here's the command (The database is mc6_erik_test, everything else is just a table list until you get to the end) exec("mysqldump -u root -pPassword -h vfmy1-dev.mountainmedia.com mc6_erik_test access_log admin affiliate affiliate_2_produ...

PHP exec - missing output

Hi there, I am currently trying to get SoX working through PHP. It all works so far, but I don't get the output back. I've already read that one might route stderr also to the output with "2>&1" .. the problem is, this doesn't seem to work on windows machines. any other ideas? code is as follows: exec($path2sox . '/sox ' . $cmd . ' 2...

PHP function problem

Hello, i have this little script, which should ping the IPs in the $hosts_to_ping array. This PHP is called with JS in the index.html. But something is wrong, because the $rval is always 1 (which mean the host is unreachable). But i know that the first two host is alive. So I print the $res variable, and i see the message: Need to gi...