how to execute shell commands (linux)?
Posted: Wed May 30, 2007 6:36 am
Hi, I am very new to php.
I am trying to execute a shell program from php.
Basically i am trying to execute the following shell command "ls -la > list.txt"
I ve tried exec() and shell_exec() functions but neither will do...
Basically it will execute ls-la or whoami or commands like that but it will not execute commands like mkdir or some command that will create a file.
I believe that the problem might be permission related.
I am using fedora core 6 (selinux disabled).
As far as I know apache on fedora has full permissions only on /tmp directory (which is where i try to create my files...).
Where can i search for error logs?
Thanx in advance people and sorry if i ask something stupid but i am really stuck...
I am trying to execute a shell program from php.
Basically i am trying to execute the following shell command "ls -la > list.txt"
I ve tried exec() and shell_exec() functions but neither will do...
Basically it will execute ls-la or whoami or commands like that but it will not execute commands like mkdir or some command that will create a file.
I believe that the problem might be permission related.
I am using fedora core 6 (selinux disabled).
As far as I know apache on fedora has full permissions only on /tmp directory (which is where i try to create my files...).
Where can i search for error logs?
Thanx in advance people and sorry if i ask something stupid but i am really stuck...