When I try to execute something legitimate - it works, like
$result = `git tag`
returns me a list of available tags.
But when I do something that should return error, like
$result = `git clone https://`
it returns me NULL
, but not message fatal: could not create work tree dir ''.: No such file or directory
that I would see in the console.
How can I run a command and get error message from PHP?
UPD: It is not question "how to clone repo with using PHP", it is "How to retreive error message if something goes wrong" Does not matter what, in my example - "broken" repository link.