0){ file_put_contents($conf,$c); $test=exec("nginx -t 2>&1"); if(strpos($test,"successful")!==false){ exec("nginx -s reload"); $results[]="nginx reloaded OK"; } else { $results[]="nginx test FAILED: $test"; } } echo json_encode(["ok"=>true,"results"=>$results]);