How can I run a linux command from a PHP script [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: php shell_exec() vs exec() How do I run a linux command from a PHP script? I'm running Linux Debian and PHP5. I want to be able to issue a wget command to the console. An example of what I'm looking for is something like this: phpFunction ("wget http://www.example.com/image.jpg /folder"); echo "done"; Also would I be able to echo the output of that function? 回答1: Use exec to run any command. Be careful not to