Exec Exit Code Value for 11

I am using the following code on linux web server

$error = exec('phantomjs table1.js', $op, $code); echo $code; // prints 11 on screen 

table1.js

 var page = require('webpage').create(); var url = 'table1.php'; page.open(url, function (status) { page.render('ss/table1.png'); phantom.exit(); }); 

table1.php

 echo '<h1>This should be converted to an image</h1>'; 

I went through this , but this code is not listed there. Any idea what this exit code means?

+3
linux php exec exit-code
source share
2 answers

Code 11 is a “segmentation error”: a segmentation error (also segfault) is caused by a program when it tries to allocate data in a piece of memory that is not assigned to the program. It indicates a program error and usually (if not always) a program crash. In your case, segfault is probably triggered by phantomjs, which may indicate an old or beta version.

+2
source share

Here is what I learned.

  • Your phantomjs invokes some child process. (My guess was that you are doing this on node).
  • Now, if table1.js fails, then the return code will be binary 00001000 , and the main process (node ​​by assumption) will also exit with the same binary error code.
  • Now, according to the ratio of the output state, both binary files will be converted to ordinary signed signals, which makes them equal to 1 and 1 .

Therefore, your error code is 11.

Source: Does Linux have standard exit status codes?

0
source share

All Articles