0

I have a code resign script which is working well when I run it from the terminal. Exactly there is a codesign command in the script file that runs well in the terminal:

/usr/bin/codesign --force --sign "$EXPANDED_CODE_SIGN_IDENTITY" "$DYLIB"

If I run the same script file from PHP, it will give me this error message:

error: The specified item could not be found in the keychain.

Please help me thank you

Thamaraiselvam
  • 6,961
  • 8
  • 45
  • 71
yongrui
  • 13
  • 6
  • You can log the arguments that are passed into the script in both cases and see if there is any difference. Consider also running with `set -x` and piping out to a log file, at least until you can understand what is different about the invocations. I have a feeling that the arguments are not being passed in as you expect, perhaps because those environment variables are not being setup correctly in the process that is exec'd. – Jameson Apr 28 '17 at 00:15
  • I recommend you to add the PHP code, especially around the line where you get the error. This will help us to identify the cause. – Teocci Apr 28 '17 at 00:29
  • Thank you for replies, I am running script via php popen that is $proc = popen("$cmd 2>&1 ; echo Exit status : $?", 'r'); the script is same as https://github.com/vtky/resign/blob/master/resign/scripts/resign.sh – yongrui Apr 28 '17 at 01:27
  • To Jameson: arguments are well passed. i think php can't run codesign command properly. – yongrui Apr 28 '17 at 01:30

1 Answers1

0

this is the privilege problem, _www can't access

yongrui
  • 13
  • 6