I am writing an app for iOS that will start the php binary as a sub process.
The following code is used:
NSString * command = @"/bin/sh -c '"; command = [command stringByAppendingString:[BibleditPaths php]]; command = [command stringByAppendingString:@" -v' > /tmp/php.txt 2>&1"]; int output = system ([command UTF8String]); NSString* msg = [@(output) stringValue]; NSLog(msg, @"");
The php binary can be started on a jailbroken iPad from the command line. This is the output:
PHP 5.4.31 (cli) (built: Aug 19 2014 11:06:21) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
When starting the php binary from the code above, iOS sends the SIGKILL signal. The php binary does not run or produce any output.
/bin/sh produces this output:
sh: line 1: 2806 Killed: 9 /bin/sh -c '/var/mobile/Applications/DFE552CC-ECBE-4A73-82CF-24870E5D9F62/Library/usr/local/bin/php -v' > /tmp/php.txt 2>&1 2014-09-15 17:33:41.676 PHPRunner[2804:60b] 35072
What can I do to get iOS to run this process successfully?