"how can i run a linux command from a php script " Code Answer

2

use exec to run any command. be careful not to exec any user input though, as it can severely compromise your server.

also, note that most shared servers block off the exec function so you won't be able to use it.

finally, as a shorthand, you can wrap the command you want to exec in backticks.

By Moudiz on February 26 2022

Answers related to “how can i run a linux command from a php script ”

Only authorized users can answer the Search term. Please sign in first, or register a free account.