I have a PHP script that calls a C# program with mono:
exec("/opt/mono/bin/mono myprog.exe param1 param2");
When I execute my script on terminal as root:
# php myscript.php
myprog.exe is executed normally. But when I try to execute this script as apache user (on browser user click in submit button with form action = myscript.php) I received error 11 on PHP exec function. What am I doing wrong?
I already made
chmod 777 /opt/mono/bin/mono
and in the program that I am running
chmod 755 myprog.exe
myprog.exe is in apache folder /var/www/html.
I'm using CentOS on Azure and mono version 3.2.8 (installed as described in https://gist.github.com/andreazevedo/9479518)
This is happening only in server. At my local machine its working.
I received error 11 on PHP exec
Error 11 is segmentation fault. PHP is reading and executing myprog.exe properly. But mono/myprog.exe ITSELF is breaking.
If you can execute it fine as your user it maybe that apache or php is not allowing enough memory to be used for mono/myprog.exe? Check your configs.