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)
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 公交车和无人机协同运输
- ¥15 stm32代码移植没反应
- ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
- ¥100 连续两帧图像高速减法
- ¥15 组策略中的计算机配置策略无法下发
- ¥15 如何绘制动力学系统的相图
- ¥15 对接wps接口实现获取元数据
- ¥20 给自己本科IT专业毕业的妹m找个实习工作
- ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
- ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)