Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图从 php 中的 shell_exec() 函数执行这个命令,我得到一些错误输出:
警告:找不到配置文件!警告:没有配置读取,使用内置默认值!打开设备时出错,它不存在。
但是,当我尝试直接在命令提示符内执行此操作时,它可以工作。我已经检查了Gammu中的所有配置文件,没有发现任何错误。那么,我可能有什么问题呢?
从 PHP 执行时,您很可能以不同的用户身份执行程序,因此它看不到您的配置。将 Gammu 配置复制到 PHP 用户主目录或在命令行上指定配置路径:
gammu --config /path/to/gammurc ...