开发者

PHP script can't open a file when called from a perl script

I have an interesting situation where I have a perl watcher script (using Linux::Inotify2) watch for files to be 开发者_StackOverflow社区dropped in a certain directory, then hand them off to a PHP script for processing. The watched directory and the files in it are not owned by the user the watcher script is running under, but the entire directory tree the files are being dumped in are rwxr-xr-x and the file is world readable.

Here's my delemma. The PHP script cannot open a file handle on the file passed to it when called from the perl script using system(), exec() or ``. However, the PHP script can open a file handle on the same file when the script is run manually from the command-line using the same effective user.

Anyone have any ideas why this would be the case?


Your fopen() calls probably rely on relative paths that break when the working directory change.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜