V
V
Vladimir Yegudin2018-10-30 21:56:51
PHP
Vladimir Yegudin, 2018-10-30 21:56:51

Why is_executable and is_file don't work, but shell_exec does?

Tell me why when I write this code:

$res = is_executable("/usr/bin/convert");
var_dump($res);

result is FALSE
When like this:
$res = is_executable("/var/www/html/1.sh");
var_dump($res);

result is TRUE
When such:
$res = shel_exec("/usr/bin/convert");
echo $res;

result - "Version: ImageMagick 6.8.9-9 Q........" and so on
. That is, a file located locally with the site - the function normally determines whether it is executable or not. And if the file is located somewhere outside the site, then the result is always false. Although if the file is called, it will be executed and return the result.
At /usr/bin/convert - a link is located, not an executable file - I tried to specify the full address of the file itself, I tried the functions is_file, is_link - always false
The problem became when installing mediawiki, which does not see all the shell components that are installed. They are, they are called, but she considers that they are not there, since is_executable returns false

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Egudin, 2018-10-30
@vivaldy

I solved the problem - I specified Apache in the config settings,
but it's not safe, I think I'll do the installation, and then I'll remove it.

S
Softer, 2018-10-30
@Softer

What if it's like this?
Shebang registered at all?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question