首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >来自网页的php popen(exim)

来自网页的php popen(exim)
EN

Stack Overflow用户
提问于 2015-05-29 19:36:16
回答 1查看 77关注 0票数 0

问题: Apache访问/usr/bin中的程序

平台:

代码语言:javascript
复制
 Win/7 Pro Sp1     Apache  2.4     Php 5.6     Cygwin emulator gives Linux/Unix emu and has         Exim    4.84-1

程序: sendit.php

代码语言:javascript
复制
hndl popen( exim ... )
    fwrite(hndle, email_headers);
    fwrite(hndle, email_body);
fflush(hndle);
fclose(hndle);

(A)从用户帐户sendit.php -> -> / exim _main.log更新报告368字节发送到exim->电子邮件到达

演示sendit.php工作& Exim和权限是正确的

(B)从apache帐户启动uid(apache) gid(srvc) php sendit.php -> exim/ exim _main.log更新报告368字节发送到exim ->电子邮件到达

演示sendit.php从任何帐户运行。

(C)从网页内启动Apache是从自己的uid/gid运行的,如(b)所示

  • page.phtml sendit.php -> NO更新进出口日志 ->没有邮件记录 报告相同的NNN字节发送给exim 无I/O错误 我fwriting_stream 368字节..。 *写了体片段368 *共写了368篇 我写了一篇正文: 368篇中的368篇 我写了EOT(5) of 5 冲洗管 I闭管 我是封闭的管道 我回来了3

将-d+deliver+host_lookup+lookup+rewrite选项添加到popen()中,会产生很好的跟踪--

除了使用Apache运行时-什么都不会出现。

Apache在目录中有ExecCGI,在那里运行其他php / perl程序。问题是Exim不在Apache环境中(/usr/bin/exim)

因此,创建了链接/usr/bin/exim -> docroot/exim并引用此实例popen(docroot/exim .)

仍然不能通过管道->交付进出口任何想法?

顺便说一句:已经在网页上成功地使用了波芬,是的,我检查了教皇的返回。

代码语言:javascript
复制
$PIPE = popen( ... ...);if ($PIPE === false) die("*FE*);
EN

回答 1

Stack Overflow用户

发布于 2015-05-30 20:49:37

现状: 2015-05-30

问题是Windows + Cygwin pathing

PHP容忍Cygwin,因为$PATH是可用的。运行在Apache LoadModule php5_module中的"c:/php/php5.6/php5apache2_4.dll“不会

必须在服务器内使用绝对窗口路径,如c:/cygwin/bin/exim-4.84-1.exe。

php cmdPath_Tests.php

使用file_exists($path) exec查找在Apache中可用的路径

Jeff@JeffPC7% case 0尝试:$ ls -l /usr/bin/exim 1管理员无24 4月6日09:19 /usr/bin /usr/bin/exim-4.84-1.exe

Jeff@JeffPC7% ls -l /usr/bin/.exe/cygwin/bin/.exe{,-4.84-1}.exe c:/cygwin/bin/exim-4.84-1.exe 1 ls:无法访问/cygwin/bin/exim.exe:没有这样的文件或目录ls:无法访问/cygwin/bin/.exe 4.84-1.exe:没有这样的文件或目录lrwxrwxrwx 1管理员,2009年4月24日:19/usr/bin/ -> /usr/bin/.exe 4.84-1.exe

案例3 1尝试:-rwxr-xr-x3 Jeff None 1192467 1月25日19:16 c:/cygwin/bin/exim-4.84-1.exe

/usr/bin/exim 0 /usr/bin/exim

/usr/bin/exim-4.84-1.exe 0 1 /usr/bin/exim-4.84-1.exe

其中:在(/cygwin/bin) 1中没有exim-4.84-1.exe文件存在cmd 1 1尝试: /cygwin/bin/exim-4.84-1.exe结果:

/usr/bin/exim-4.84-1.exe 2 1尝试: /usr/bin/exim-4.84-1.exe

我发现:31试: c:/cygwin/bin/exim-4.84-1.exe

cmd结果: 2015-05-30 11:58:24 NP6FDA-000530-QD完成ie:电子邮件发送

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30537741

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档