Page 1 of 1

shell_exec() problems

Posted: Tue Jul 31, 2007 4:13 am
by akkad
Hi every body,
Actually i have full access to the shell but running this code in a php file on xampp server that i have on the linux, i am not getting the output even when i am trying to pipe the output to an html file .
<code>

shell_exec("cat `find ./logs -name access.log*` | grep akadi_icho | ./calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -F html>akadi_icho.html");

</code>
but when i am running this code on the shell directly :
<code>
cat `find ./logs -name access.log*` | grep akadi_icho| ./calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -F html>akadi_icho.html
</code>
it is working perfectly.
so i have tried to run the code in parts :
<code>
shell_exec("cat `find ./logs -name access.log*` | grep akadi_icho");
</code>
this part is working, but when i am running the whole part i am not getting any output, though the calamaris path is correct .

so plz can u help me to figure out the problem.

now idea but...

Posted: Tue Jul 31, 2007 11:14 am
by yacahuma
It always help to make since simpler. Why dont you put all that into a shell script and just call the script

Code: Select all

shell_exec('mynewscript');

shell_exec() problems

Posted: Wed Aug 01, 2007 3:50 am
by akkad
HI, [s]u[/s] you [s]r[/s]are right but i have done that also but it is not working, logicaly if this will not work the other one also will not work [s]coz[/s]because it is the same i think.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.