I had some php code working on my local windows dev and when I moved it to the dev RedHat server I can't get it to work. What I am getting back is an empty response.
public function convert(Request $request){
try{
$prince = new Prince(env("PRINCE_PATH"));
// Log::info($request->input('html'));
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="document.pdf"');
Log::info("about to send");
$prince->convert_string_to_passthru($request->input('html'));
} catch(Exception $e){
Log::error($e->getMessage());
return response($e->getMessage(), 500);
}
}
I have PRINCE_PATH set to '/usr/lib/prince/bin/prince'
I have added this to the sudoers file:
apache ALL=(user) NOPASSWORD: /usr/lib/prince/bin/prince
Is there something I am missing?
public function convert(Request $request){
try{
$prince = new Prince(env("PRINCE_PATH"));
// Log::info($request->input('html'));
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="document.pdf"');
Log::info("about to send");
$prince->convert_string_to_passthru($request->input('html'));
} catch(Exception $e){
Log::error($e->getMessage());
return response($e->getMessage(), 500);
}
}
I have PRINCE_PATH set to '/usr/lib/prince/bin/prince'
I have added this to the sudoers file:
apache ALL=(user) NOPASSWORD: /usr/lib/prince/bin/prince
Is there something I am missing?