I am running this command opendkim-genkey --domain=example.com --selector=example --subdomains
on Linux terminal, It is working properly, but when I try to run this in my PHP page like
shell_exec("opendkim-genkey --domain=example.com --selector=example --subdomains");
this is not working..
I also try to run another command in my php page, and I get result of them.
opendkim命令无法使用PHP
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- dongshaoxiong0012 2015-02-26 05:44关注
I can see three explanations:
opendkim-genkey
is not found because the environment variables are not the same: use an absolute pathYour Apache (or other webserver) user does not have permission to execute this command: you can use sudo, see https://serverfault.com/questions/157272/allow-apache-to-run-a-command-as-a-different-user
And as @rups suggested, your user may need write permission (if
opendkim-genkey
generates a key file)
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥16 Qphython 用xlrd读取excel报错
- ¥15 单片机学习顺序问题!!
- ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
- ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
- ¥15 相敏解调 matlab
- ¥15 求lingo代码和思路
- ¥15 公交车和无人机协同运输
- ¥15 stm32代码移植没反应
- ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
- ¥100 连续两帧图像高速减法