I have a similar question here that I asked the other day, but thought I would post a second one for a more simple problem.
It seems I can get the PHP exec() method to open any Application on my Mac except for Unity (5 applications chosen at random of varying memory size all succeeded). It always crashes due to some mysterious exception that is posted to Apache’s error_log
. The details of the exception are never included. A return code of 6
is always fed back to PHP as well, but there’s no way of knowing what return code 6 actually means.
If you are hosting a PHP server and are on a Mac, I invite you to please try and execute this PHP script on your server and to let me know if it works. If you are on a PC, you’ll just need to change the path to Unity.
Note: If you receive "Error #-5000 while verifying your authorization. Unknown error."
while attempting to run this script, I was able to “fix” that by changing User and Group inside of /private/etc/apache2/httpd.conf
to my username/group (instead of the default _www).
<?php
$retval = -1;
$output = null;
$program = "/Applications/Unity/Unity.app/Contents/MacOS/Unity";
exec($program, $output, $retval);
echo "<pre>".var_export($output, TRUE) . "</pre>";
echo "Return Value: $retval";
die;
?>