shell-exec

php shell_exec doesn't work in browser but works in terminal

时光毁灭记忆、已成空白 提交于 2019-12-01 13:38:29
I'm working on shell_exec and it doesn't run in browser but works in terminal. Here's my code: <?php echo 1; shell_exec ("gpg --output /home/datafeeding/testing/sampledick.xls.gpg --encrypt --recipient rtalplacido@yahoo.com /opt/jasperserver-3.5.0/apache-tomcat/webapps/JavaBridge/reports/sampledick.xls"); echo 2; echo "<br>"; ?> It echo 2 , it just passes through the shell exec Roman Newaza http://php.net/manual/en/function.shell-exec.php Note: This function is disabled when PHP is running in safe mode. Also, add full path you gpg binary - /usr/bin/gpg See this post: GPG Error Code 2 来源: https

php shell_exec doesn't work in browser but works in terminal

邮差的信 提交于 2019-12-01 12:02:10
问题 I'm working on shell_exec and it doesn't run in browser but works in terminal. Here's my code: <?php echo 1; shell_exec ("gpg --output /home/datafeeding/testing/sampledick.xls.gpg --encrypt --recipient rtalplacido@yahoo.com /opt/jasperserver-3.5.0/apache-tomcat/webapps/JavaBridge/reports/sampledick.xls"); echo 2; echo "<br>"; ?> It echo 2 , it just passes through the shell exec 回答1: http://php.net/manual/en/function.shell-exec.php Note: This function is disabled when PHP is running in safe

shell_exec() and exec() not working in PHP

孤街浪徒 提交于 2019-12-01 10:54:01
Like many others I have problem with shell_exec() function in PHP. I have safe mode disabled and disabled_functions deleted from php.ini. If I run php script from terminal (php print.php) it's working perfectly but if I run it from web browser nothing happens. Here is the scipt: <?php $output = shell_exec('lp print.php'); echo "<pre>$output</pre>"; ?> Please help me. I'm running PHP 5.3.10 on Apache2. My OS is Ubuntu Server 12.4. Here is the phpinfo page: http://testni-server.info/info.php Progamming language PHP allows one to limit executing of external commands via configuration directive

Calling bash with PHP's shell_exec — slow

烈酒焚心 提交于 2019-12-01 10:44:53
问题 I'm using PHP's shell_exec function to call a bash script on my server. shell_exec("bash -x /tesladata/isetools/0-extractbytickerforweb.bash $ticker $isedate > /t24alv2/iseoutput/$ticker-$isedate-$thistime.log &"); Now, I previously had the command running from a CGI script ("bash -x...") and it was much faster (instantaneous). Now it takes a painfully slow time for the script to run (> 10sec) and for the resulting page to render. Any ideas why this is so slow? I'd still like to run the bash

PHP shell_exec, permission denied for executing -rwxrwxrwx shell script

有些话、适合烂在心里 提交于 2019-12-01 10:43:57
I am currently over ssh on a remote CentOS 5.6 system which runs an Apache webserver. I need to use the poppler pdftohtml binary which, unfortunately, is not currently installed on that machine. So I downloaded the poppler package and built it under my user folder. Since I I am not the system admin, I didn't do make install and I have all my compiled files under /users/myfolder/poppler-0.18.2/ The file that I need to execute through php shell_exec() is /users/myfolder/poppler-0.18.2/utils/pdftohtml If I execute it through my ssh bash, I get the correct output. If I, instead, put this line on a

PHP shell_exec, permission denied for executing -rwxrwxrwx shell script

北慕城南 提交于 2019-12-01 08:33:04
问题 I am currently over ssh on a remote CentOS 5.6 system which runs an Apache webserver. I need to use the poppler pdftohtml binary which, unfortunately, is not currently installed on that machine. So I downloaded the poppler package and built it under my user folder. Since I I am not the system admin, I didn't do make install and I have all my compiled files under /users/myfolder/poppler-0.18.2/ The file that I need to execute through php shell_exec() is /users/myfolder/poppler-0.18.2/utils

Calling Python from within PHP using shell_exec

元气小坏坏 提交于 2019-12-01 08:20:42
问题 My default Web-Application is based on PHP. However, for easiness, I have built a python script that does some analysis. Now I need the php to call the python code and retrieve the output that the python code delivers. Both files are in the same server, not on the same folder however. My current approach, which does not work, looks as following: $cmd = "/usr/bin/python /var/www/include/sCrape.py -u '$my_url' "; $response = shell_exec($cmd); $response = json_decode($response, true); Now when I

Connecting to Gmail IMAP PHP “Couldn't open stream”

柔情痞子 提交于 2019-12-01 03:02:16
There are lots of people having similar issues but no one is answering their questions. I have IMAP enabled in PHP, Using all the correct information. I don't see where I'm going wrong. Here's my code: $hostname = '{imap.gmail.com:995/imap/ssl/novalidate-cert}'; $username = 'emailaddress@gmail.com'; $password = 'password'; $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error()); print_r(imap_errors()); Not returning any errors other than: Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:995/imap/ssl/novalidate

shell_exec not working with nmap command

非 Y 不嫁゛ 提交于 2019-12-01 02:14:02
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 with execute the nmap command. I've check that command in the shell command line in putty and its

PHP shell_exec wait for script to finish? [duplicate]

不羁岁月 提交于 2019-11-30 19:48:14
This question already has an answer here: php exec command (or similar) to not wait for result 5 answers I have a PHP script that queries a database for a list of jobs to be done and fires off other PHP scripts based on what it finds in the database (basically a process queue). Some of the scripts that the queue runner script executes may take 30 seconds or so to finish running (generating PDFs, resizing images, etc). The problem is that shell_exec() in the queue runner script calls the processing scripts, but then doesn't wait for them to finish, resulting in the queue not being completed.