error executing shell_exec

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
celalo
Forum Newbie
Posts: 1
Joined: Wed Aug 19, 2009 10:03 am

error executing shell_exec

Post by celalo »

hello, I am trying to execute a shell command via:

Code: Select all

<php echo shell_execute("tac /home/kusmuk/access-logs/kusmuk.org"); ?>
But it does not give any output. What could be the reason?

altough it does not work those following lines works as expected:

Code: Select all

<php echo shell_execute("ls -al triogrup.com"); ?>
//outputs: -rw-r----- 2 root kusmuk 28640 Aug 19 17:44 kusmuk.org

Code: Select all

<php echo shell_execute("pwd"); ?>
//outputs: /home/kusmuk/public_html
AlanG
Forum Contributor
Posts: 136
Joined: Wed Jun 10, 2009 1:03 am

Re: error executing shell_exec

Post by AlanG »

The function name is shell_exec(), change it to that. Did those other commands work with shell_execute()?
Post Reply