shell-exec

php shell_exec executing java program

你说的曾经没有我的故事 提交于 2019-12-07 11:36:51
问题 In PHP code I try to execute Java program using shell_exec but I get empty line. When I tried to execute program in bash: #bin/bash echo "aaa" I get "aaa" but when i tried to execute the same file with #bin/bash java MainApp I got empty line This is the java code public class MainApp{ public static void main(String[] args) { System.out.print(":]"); } } When i do: #bin/bash echo "aaa" java MainApp echo "bbb" I get "aaa bbb" I wont to get ":]" string How to make it work? Maybe printing line

Two Shell_Exec Command with PHP button but still in the One powershell?

笑着哭i 提交于 2019-12-07 09:31:54
问题 I have Powershell syntax that can get data using ReadExisting(), but the problem is... that syntax must compele php condition before (and some shell_exec syntax when page load) I trying Get COM1 Data using powershell, and its working with this code cmd powershell in that image, the first ReadExisting() can't declare the output because the device in COM1 not showing new result, when the devices show the result, trying the ReadExisting() again and i get what i want. So (what in my opinion) the

How to execute multiple launch conditions on installer exit

孤者浪人 提交于 2019-12-07 07:30:53
问题 I've managed to get WIX to launch my application on exit, but not sure how to schedule two custom actions using the WixShellExecTarget property. One CA is to launch an app and the other is a web page based on a url from another CA. These are both launched if the appropriate checkboxes are checked. <!-- Custom action for executing app --> <Property Id="WixShellExecTarget" Value="[#Application.exe]" /> <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate=

How to get shell_exec to run on IIS 6.0

谁都会走 提交于 2019-12-07 05:37:11
问题 The Problem I have a PHP script that uses shell_exec to run a pdf-to-text converter. To simplify the problem I've created a short script that uses shell_exec to just echo the output of the dir command. <?php $cmd = 'C:\\WINDOWS\\system32\\cmd.exe /c '; echo shell_exec($cmd.' dir'); ?> When I run this on my Apache server, everything works as expected. When I switch to IIS, it's as though the line is skipped entirely: no errors, no output, no logs, no nothing. Unfortunately, I need to use IIS

php system() shell_exec() hangs the browser [duplicate]

自作多情 提交于 2019-12-07 05:32:18
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Asynchronous shell exec in PHP i need to run a java program in the background. process.php contains shell_exec("php php_cli.php") php_cli.php contains shell_exec("java -jar BiForce.jar settings.ini > log.txt"); I am calling process.php asynchronously using ajax When i click the link in the webpage that calls ajax function (for running process.php) the webage shows "loading". when i click other links at the same

shell_exec with windows path not running [closed]

老子叫甜甜 提交于 2019-12-07 03:46:24
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I am trying to run a command using shell_exec but its not returning any output. When I copy the command into command prompt it works like a charm. Here

Can't import NLTK from within phps shell_exec

£可爱£侵袭症+ 提交于 2019-12-06 08:01:07
I have a python script being called form php's shell_exec command. All works well, except that it cannot import the NLTK corpora when called through shell_exec. The very same command is executed without problems however, whenever I call it directly from shell. I am using Debian 8. This is my php-Code: $cmd = "/usr/bin/python /var/www/include/sCrape.py -u '$my_url' "; $response = shell_exec($cmd); $response = json_decode($response, true); This command works well when called directly (without sudo) from the root: /usr/bin/python /var/www/include/sCrape.py -u '$my_url' The error message from the

Loops with PHP shell_exec() : Use php for() or bash for-do-done?

不问归期 提交于 2019-12-05 20:59:11
Let's say I want to execute the command mycommand with PHP shell_exec() 10 times. Should I do a bash loop: shell_exec('for i in {1 .. 10} do mycommand -i done'); or rather a PHP loop: for($i = 1; $i <=10; ++$i) { shell_exec('mycommand -'.$i); } What are the reasons (security, performance, style, ...) to choose one over the other? Go for bash loop, because shell_exec function is called only once. It will be faster than calling shell_exec multiple times. Enabling functions like exec, shell_exec itself a huge security issue. If someone managed to upload a PHP shell in your server then he can hack

Is using shell commands from PHP/CGI bad practice?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 17:42:09
Are shell commands considered a legitimate programming interface? Specifically, is there anything wrong with executing bash shell commands on a linux application server from PHP pages or CGI files? Does this introduce efficiency or security issues? Thanks Sometimes OK, but... Sometimes it's the best way to solve a problem. But possible issues are: Security Look out for code injection if you aren't doing taint checking . Performance Running shell commands will involving forking the PHP interpreter and executing complex and relatively slow system calls . This is OK for a lightly loaded server

php shell_exec executing java program

孤人 提交于 2019-12-05 16:14:42
In PHP code I try to execute Java program using shell_exec but I get empty line. When I tried to execute program in bash: #bin/bash echo "aaa" I get "aaa" but when i tried to execute the same file with #bin/bash java MainApp I got empty line This is the java code public class MainApp{ public static void main(String[] args) { System.out.print(":]"); } } When i do: #bin/bash echo "aaa" java MainApp echo "bbb" I get "aaa bbb" I wont to get ":]" string How to make it work? Maybe printing line with System.out.println(String ) is not the same as echo and printing line is not the same as returning