Results 1 to 2 of 2
i want to run shell scripts in web with php.it worked in simple command like :
<?php
$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";
?>
but when i test with command ...
- 08-30-2010 #1Just Joined!
- Join Date
- Jul 2010
- Posts
- 11
php CGI
i want to run shell scripts in web with php.it worked in simple command like :
<?php
$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";
?>
but when i test with command like "# service iptables start
" it dosent work.because of limit access.
i think in the browser,php is runng under one user,bu when u run it in bash,it is likely running with your user premmission(root)
i added "chmod +x ..." to command but it dosnt work yet!
plz help.tanxxx
- 09-02-2010 #2Just Joined!
- Join Date
- Jul 2010
- Posts
- 11
hi.english is my secode language so sorry for any mistake.anyway tanx 4 any help.my problem is solved.
solution:
i added "apache ALL=NOPASSWD : ALL" to "/etc/sudoers" file
and make COMMENT " Defaults requiretty" to "/etc/sudoers" file
i can do "# service iptables start " or ...
now the the problem is that i have GUI "dialog utility " in my scripts.when i run it in web it dosent work and the errors are so strange.its like that i cant run dialog utility in web.what do u think about it?tanx


Reply With Quote