shell-exec

Running Linux Command from PHP

依然范特西╮ 提交于 2020-01-11 11:18:10
问题 I have a bit of a unique situation. I'm trying to run a video encoding program from a PHP script called Diascope, which relies on the 'convert' command provided by ImageMagick. I have a bash script that executes a really simple conversion and then it runs the application called Diascope. This is the conversion code, and the following does work, it creates the new file convert image.jpg image.png Shows no errors, but then I run Diascope like this diascope -clean audio.txt And I can see that

shell_exec not working with nmap command

爱⌒轻易说出口 提交于 2020-01-11 04:04:08
问题 I got a problem with the shell_exec php function, here is a example code: $output = shell_exec('nmap -PS80 -n -oG - --send-ip 11.11.11.11'); if ( $output ) { echo "Output found..."; } else { var_dump( $output ); } It does return: NULL , but when I change the shell_exec command to the following: $output = shell_exec('echo 1'); then the output is: Output found... so its working properly, and there is no problems with permissions or safe mode (which is off , by the way). It is having a problems

How to run shell script with live feedback from PHP?

泄露秘密 提交于 2020-01-09 11:23:51
问题 How would I execute a shell script from PHP while giving constant/live feedback to the browser? I understand from the system function documentation: The system() call also tries to automatically flush the web server's output buffer after each line of output if PHP is running as a server module. I'm not clear on what they mean by running it as a 'server module'. Example PHP code: <?php system('/var/lib/script_test.sh'); Example shell code: #!/bin/bash echo "Start..." for i in {1..10} do echo "

PHP shell exec not working in html browser but working on cmd prompt

十年热恋 提交于 2020-01-06 06:50:06
问题 I am running PHP 5.2.14 on Apache/2.2.16 (Win32) and I have a script to run a shell command, which when tested in the command prompt works well but in browser mode (html), it doesnt. Scripts: mybatfile.bat REM ... REM process some folder details REM code which does not work in browser mode but works in cmd mode C:/somfolder/bin/mysqldump -u abc -pabcdef --result-file="C:/Apache22/somfolder/DBbackup/DBbackup.%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%.sql" --dump-date --log-error="C:/Apache22/somfolder

Warning: shell_exec() has been disabled for security reasons - already removed from php.ini

岁酱吖の 提交于 2020-01-06 04:53:22
问题 I removed shell_exec from the disable_functions section in my php.ini script, and then proceeded to restart apache. But error as shown as the title still persists. Anyone have any idea what causing this? 回答1: Just wanted to confirm that Raptor helped answer my question. Doing a phpinfo() printout I found that the disable_functions section still had the shell_exec issue there. The problem was I had a server management software that required that I edit files from there and no the system

hide command usage argument on browser of shell_exec PHP in windows

天涯浪子 提交于 2020-01-06 02:49:19
问题 I make the traceroute web based. I use shell_exec to execute the process and show the output via browser. I have problem with the first I call the page on browser. There is usage of tracert command show. I try to hide it by place the script inside the function. yes, it works but another element like map when I start load the page doesn't show. Here is my php code : <html> <head> <title></title> <body> <? $host = @$_POST['host']; $trace = @$_POST['trace']; $self = $_SERVER['PHP_SELF']; ?> ...

php shell_Exec not working while the command works in shell

天大地大妈咪最大 提交于 2020-01-05 12:34:33
问题 I have to use imagemagick convert command from php. So I'm using shell_exec but the output of that is null string. I know that the command convert doesn't print anyting on STDOUT but the desired output of convert is also not achieved. also exec doesn't work. these commands run fine from shell or from php command line. What can be the issue? EDIT :adding the 2>&1, I learn that convert is throwing an error : missing an image filename /a5d98168a524a331c5e06d60096debd63cbdce1f.jpg' @ error

GLIBCXX_3.4.9 not found ubuntu

橙三吉。 提交于 2020-01-03 05:51:26
问题 i am trying to convert .doc file to .html file using shell_exec command php.. for this i have written the below code: $result = shell_exec("soffice --headless --convert-to html /opt/lampp/htdocs/converter/public/uploads/resume/".$filename." 2>&1"); echo $result; but i am getting this when i run the project from the browser: /usr/lib/libreoffice/program/oosplash: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /usr/lib/libreoffice/program/../ure-link/lib/libuno

exec() keeps executing the command Again and Again like an infinite loop, despite of No loop in the program

こ雲淡風輕ζ 提交于 2020-01-03 04:35:44
问题 ADDENDUM: The problem in the question below is due to the SECOND command. When I comment out the second statement, the first one runs as expected and produces expected results. :s I needed to run two terminal commands from PHP SIMULTANEOUSLY, and nothing was solving my problem (as you can see here and here, if you want to). The first command is supposed to run Tshark for 5 seconds and capture network traffic (packets). The second command was supposed to generate some network packets and send

how to print on client printer from server using php

喜你入骨 提交于 2020-01-01 15:36:14
问题 I want to print a pdf file(pdf file is on server) using php (php is also running on server) on client computer. How can I do this. Thanks in advance for you help 回答1: You cannot do this directly, as the php/apache server runs on a completely different computer(and maybe geographic location) than the browser/client. You can however use intermediate solutions, like proprietary, custom applications installed on the client's computer that "talks" to the server and requests files to be printed.