问题: Apache访问/usr/bin中的程序
平台:
Win/7 Pro Sp1 Apache 2.4 Php 5.6 Cygwin emulator gives Linux/Unix emu and has Exim 4.84-1程序: sendit.php
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)所示
将-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 .)
仍然不能通过管道->交付进出口任何想法?
顺便说一句:已经在网页上成功地使用了波芬,是的,我检查了教皇的返回。
$PIPE = popen( ... ...);if ($PIPE === false) die("*FE*);发布于 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:电子邮件发送
https://stackoverflow.com/questions/30537741
复制相似问题