osx - php exec not working on mamp -


i'm trying launch executable myapp made unity using following code in php, i'm getting errors.

<?php echo "yo"; echo exec('whoami',$output,$retval); echo $retval; echo exec('myapp.app',$output,$retval); echo $retval; echo exec('/applications/mamp/htdocs/myapp.app/',$output,$retval); echo $retval; ?> 

the result yodan127127. 127 looked in error codes means procedure not found.

i have commented out lines in applications/mamp/library/bin/envvars_ recommended in other posts.

i have put myapp.app in several directories htdocs,bin,cgi-bin, gives same error.

#if test "x$dyld_library_path" != "x" ; #  dyld_library_path="/applications/mamp/library/lib:$dyld_library_path" #else #  dyld_library_path="/applications/mamp/library/lib" #fi #export dyld_library_path # 

you have point exec binary, , not container it.

the .app container directory has internal structure, binary somewhere in path should /applications/mamp/htdocs/myapp.app/contents/macos/myapp. precise location of binary in /applications/mamp/htdocs/myapp.app/info.plist file. can right click on app , select show package contents view structure.

but easiest way run app open open command:

open '/applications/mamp/htdocs/myapp.app/' 

it should runnable php argument exec.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -