exec () does not execute the passed command

1

I'm trying to use the exec() PHP function to execute a .jar file (I know it's not a good practice, but it's the only solution I have at the moment), but I'm not getting good results. >

The code in question:

exec(java -jar /home/sistemas/relatorios/jasper_reports/NaturatinsJasperReports/NaturatinsJasperReports.jar 'SELECT * FROM ambiental.vw_fin_fua_ato_azul WHERE id_fua = 31968408 ' '/home/sistemas/relatorios/jasper_reports/jasper/memoria_calculo_azul.jasper' '/home/sistemas/relatorios/memoria_calculo_azul.pdf' '/home/sistemas/relatorios/jasper_reports/NaturatinsJasperReports/desenvolvimento.xml', $output)

I execute and simply get empty feedback. The variable $output is set with a Array and nothing else. However, the parameter-driven command works perfectly when executed via the terminal.

Does anyone have any ideas?

Thank you.

    
asked by anonymous 27.05.2014 / 13:59

1 answer

1

It may be the user's permission, basically you are running the web server with an X user, so you can only run programs and functions where user X has permissions.

Try changing the permissions of the file or the user that the server uses.

    
27.05.2014 / 14:34