1

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

Dmitrij Holkin
  • 1,995
  • 3
  • 39
  • 86
  • Take a look [here](http://stackoverflow.com/questions/7565081/alternate-to-php-exec-function) to check out if you can use any of the other functions. – mrun Jan 07 '16 at 09:50

1 Answers1

0

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);
Harikrishnan
  • 9,688
  • 11
  • 84
  • 127