What is the difference between shell_exec and system methods in PHP?
shell_exec
system
Both take one command line argument and run this in PHP. Is it better to use one over the other?
You can lock a return code with the system. Already with shell_exec it is impossible.
See explanation here:
http://chipmunkninja.com/Program-Execution-in-PHP% 3A-exec-m@
I think the main difference is that PHP is running in safe mode. The system will work with some restriction, as described in the documentation, however shell_exec will be disabled.
Source: https://habr.com/ru/post/916955/More articles:Regenerate evolution scenarios in game 2 - playframeworkCreating a global variable (from a string) from inside a class - pythonHow to resize browser window when starting FirefoxWebDriverProvider in JBehave Web - seleniumIs it safe to use pip with a git repository? - pythonIs List a good replacement for ArrayList? - arraylistIs it possible to call the performSelectorOnMainThread function: after calling the beginBackgroundTaskWithExpirationHandler function and the application is in the background? - multithreadingotest crash with - [id userCredential:] - iosanother behavior or sqrt when compiling with 64 or 32 bits - cJava Slick scale Image without anti-aliasing - javaicepdf-core maven install in Eclipse not working - javaAll Articles