Php,nodejs

if 0 is returned, the execution is successful, but it is obvious that the execution of nodejs failed. How can exec execute nodejs, to determine whether the execution is successful or not?

Mar.01,2021

I guess you started a node.js process to execute a script in php with exec ? You can write a js script that executes the script you really want to execute, and catch uncaught exceptions in this script to determine whether the execution is successful or not. If it fails, process.exit (1) . I'm not sure how php's exec is executed. If this doesn't work, you can inform the parent process of its execution status by communicating with other processes

.
Menu