如何在共享驱动器上执行xpdf(pdftotext.exe)? [英] How to execute xpdf (pdftotext.exe) on shared drive?

查看:370
本文介绍了如何在共享驱动器上执行xpdf(pdftotext.exe)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试通过 PHP XPDF pdf 为文字 c $ c>(pdftotext.exe)。

im trying to parse pdf to text via PHP and XPDF (pdftotext.exe). On my localhost everythings works well, but when im trying to move everything on server, im getting into troubles.

首先,我检查了服务器上的一些设置,safe_mode是关闭 exec 未禁用,权限为 rwxrwxrwx

First of all i checked some settings on server and safe_mode is off, exec is not disabled and permissions are rwxrwxrwx.

然后尝试此

$command = "\\\\149.223.22.11\\cae\\04_Knowledge-base\\tools\\pdftotext.exe -enc UTF-8 ". $fileName . " \\\\149.223.22.11\\cae\\04_Knowledge-base\\output.txt";


$result = exec($command,$output,$args);
echo shell_exec($command);

这不工作。当我查看 $ result,$ output,是空的,但$ args返回1,这对应于此函数 http://www.hiteksoftware.com/knowledge/articles/049.htm\">windows系统错误代码

which isnt working. When i look into $result, $output, are empty, but $args returns 1 which coresponds to Incorrect function by this document windows system error codes

整个命令看起来像 \\149.223.22.11\cae\04_Knowledge-base\tools\pdftotext.exe -enc UTF-8 \\149.223.22.11\cae\04_Knowledge-base\testpdf\\ \\ 04_egerland_final_paper.pdf \\149.223.22.11\cae\04_Knowledge-base\output.txt 并且当被直接输入到命令行时,它的工作。

Whole command looks like \\149.223.22.11\cae\04_Knowledge-base\tools\pdftotext.exe -enc UTF-8 \\149.223.22.11\cae\04_Knowledge-base\testpdf\04_egerland_final_paper.pdf \\149.223.22.11\cae\04_Knowledge-base\output.txt and when is dirrectly inputed into commandline, its working.

因此,有点想法。有人有任何提示吗?

So im a bit out of ideas. Have someone any hint?

编辑20160201 - aditional attempt
所以我做了条件测试,当我试图运行类似的命令与exec从localhost文件,输入和输出文件在同一位置,只有im使用localhost而不是服务器)它的工作。我现在检查服务器设置的差异。所以这里可能有问题,localhosts服务器Api是 Apache 2.0 处理程序和服务器是 CGI / FASTCGI

edit 20160201 - aditional trying So i made aditional tests and when im trying to run similar command with exec from localhost (target .exe file, input and output file is in same location, only im using localhost not server) its working. Im now checking differences in server settings. So can here be problem, that localhosts Server Api is Apache 2.0 Handler and server is CGI/FASTCGI?

推荐答案

所以这是我的一边的错误。我严重检查IIS权限,忘记分配用户到虚拟目录,我wana访问。所以我唯一的建议和更多的智慧,从这是双倍(也许三)检查你是否所有权限设置正确。

So it was all mistake on my side. I badly checked IIS permissions and forgot to assign user to virtual directory which i wana to access. So my only advice and more wisdom from this is to double (maybe triple) check if you have all permissions set correctly.

这篇关于如何在共享驱动器上执行xpdf(pdftotext.exe)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆