applescript 从终端启动但不是从 php
我有一个写入日志文件的苹果脚本。 如果从终端启动它可以完美运行,但我需要从 php 脚本启动它。 为了实现这一点,我使用了 php 的 exec 函数,但没有任何反应。
applescript 由用户“管理员”拥有 如果从 php 的 exec 我启动“whoami”,我会返回“administrator”,所以我想这不是权限问题。(applescript 也有执行权限) applescript 以
这种方式工作:
administrator$ ./myApplescript.app
Administrator$ osascript myApplescript.app
如果我尝试在 php 中运行完全相同的命令,则不会发生任何情况。
有人遇到类似的事情吗? 提前致谢! 最好的问候
PS 网络服务器是 mac Os x 上的 MAMP
I have an applescript which writes a log file.
It works perfectly if launched from the terminal, but i need to launch it from a php script.
For achieving this I use the exec function of php but nothing happens.
The applescript is owned by the user "administrator"
If from php's exec i launch "whoami" I get back "administrator" so I guess it's not a problem of permission.(the applescript has also execution permission on it)
The applescript works both in this ways:
administrator$ ./myApplescript.app
administrator$ osascript myApplescript.app
If I try to run the very same commands inside php nothing happens.
Someone faced something similar?
Thanks in advance!
Best regards
P.S.
The webserver is MAMP on mac Os x
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过
确保您调用的路径实际上是正确的并且网络服务器可以访问该文件。
Have you tried
make sure that the path you call is actually correct and that the webserver has access to this file.
确保用户已登录到您也运行 php 的 Mac,否则它将无法正常工作。
Make sure a user is logged in on the Mac you're running the php from too or else it won't work properly.