PHP exec() on External Script File

/ Published in: PHP
Save to your folder(s)

I couldn't get PHP running a local Python script even when there were no permission problems. Trick was the '2>&1' at the end.

Copy this code and paste it in your HTML
  1. $command = 'your command goes here';
  2. $output = exec($command . ' 2>&1', $output, $return);


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.