1
votes

I need to run function on my server

exec('grep '.escapeshellarg($line).' '.$myFile)

But exec is disabled for security reasons But PHP execute function is working eval and preg_replace.

It is possible to do the same thing using php function?

Disabled function

link, symlink, exec, passthru, proc_close, proc_get_status, proc_open, shell_exec, system, popen, pclose

1
Take a look here to check out if you can use any of the other functions. - mrun

1 Answers

0
votes

All php functions able to execute command in shell are disabled in your server. So forget about exec family of functions.You need to open file and check for the pattern.

$file = file_get_contents ($myFile);
preg_match_all ($line, $file, $matches);
print_r ($matches);