Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executable not found, proposed : /opt/local/xpdf/bin/pdftotext #12

Open
sagarguhe opened this issue Aug 22, 2016 · 4 comments
Open

Executable not found, proposed : /opt/local/xpdf/bin/pdftotext #12

sagarguhe opened this issue Aug 22, 2016 · 4 comments
Assignees
Labels

Comments

@sagarguhe
Copy link

I have used the following initialization:

$pdfToText = XPDF\PdfToText::create(array(
    'pdftotext.binaries' => '/usr/bin/pdftotext', // notice here I have given a path to pdftotext executable on my pc
    'pdftotext.timeout' => 30, // timeout for the underlying process
));

but still it is finding the executable in '/opt/local/xpdf/bin/pdftotext' and giving me the following error trace:

[Mon Aug 22 15:24:34.602132 2016] [:error] [pid 5912] [client 127.0.0.1:44733] PHP Fatal error: Uncaught exception 'Alchemy\\BinaryDriver\\Exception\\ExecutableNotFoundException' with message 'Executable not found, proposed : /opt/local/xpdf/bin/pdftotext' in /var/www/html/PHP-XPDF/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:160\nStack trace:\n#0 /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php(196): Alchemy\\BinaryDriver\\AbstractBinary::load('/opt/local/xpdf...', NULL, Object(Alchemy\\BinaryDriver\\Configuration))\n#1 /var/www/html/PHP-XPDF/index.php(8): XPDF\\PdfToText::create(Array)\n#2 {main}\n\nNext exception 'XPDF\\Exception\\BinaryNotFoundException' with message 'Unable to find pdftotext' in /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php:198\nStack trace:\n#0 /var/www/html/PHP-XPDF/index.php(8): XPDF\\PdfToText::create(Array)\n#1 {main}\n thrown in /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php on line 198 [Mon Aug 22 15:24:35.537723 2016] [:error] [pid 4627] [client 127.0.0.1:44734] PHP Fatal error: Uncaught exception 'Alchemy\\BinaryDriver\\Exception\\ExecutableNotFoundException' with message 'Executable not found, proposed : /opt/local/xpdf/bin/pdftotext' in /var/www/html/PHP-XPDF/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:160\nStack trace:\n#0 /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php(196): Alchemy\\BinaryDriver\\AbstractBinary::load('/opt/local/xpdf...', NULL, Object(Alchemy\\BinaryDriver\\Configuration))\n#1 /var/www/html/PHP-XPDF/index.php(8): XPDF\\PdfToText::create(Array)\n#2 {main}\n\nNext exception 'XPDF\\Exception\\BinaryNotFoundException' with message 'Unable to find pdftotext' in /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php:198\nStack trace:\n#0 /var/www/html/PHP-XPDF/index.php(8): XPDF\\PdfToText::create(Array)\n#1 {main}\n thrown in /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php on line 198 [Mon Aug 22 15:24:36.380343 2016] [:error] [pid 7571] [client 127.0.0.1:44735] PHP Fatal error: Uncaught exception 'Alchemy\\BinaryDriver\\Exception\\ExecutableNotFoundException' with message 'Executable not found, proposed : /opt/local/xpdf/bin/pdftotext' in /var/www/html/PHP-XPDF/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:160\nStack trace:\n#0 /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php(196): Alchemy\\BinaryDriver\\AbstractBinary::load('/opt/local/xpdf...', NULL, Object(Alchemy\\BinaryDriver\\Configuration))\n#1 /var/www/html/PHP-XPDF/index.php(8): XPDF\\PdfToText::create(Array)\n#2 {main}\n\nNext exception 'XPDF\\Exception\\BinaryNotFoundException' with message 'Unable to find pdftotext' in /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php:198\nStack trace:\n#0 /var/www/html/PHP-XPDF/index.php(8): XPDF\\PdfToText::create(Array)\n#1 {main}\n thrown in /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php on line 198 [Mon Aug 22 15:34:10.858116 2016] [:error] [pid 10193] [client 127.0.0.1:44883] PHP Fatal error: Uncaught exception 'XPDF\\Exception\\InvalidArgumentException' with message 'sample.pdf is not a valid file' in /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php:133\nStack trace:\n#0 /var/www/html/PHP-XPDF/index.php(10): XPDF\\PdfToText->getText('sample.pdf')\n#1 {main}\n thrown in /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php on line 133 [Mon Aug 22 15:39:16.753952 2016] [:error] [pid 4631] [client 127.0.0.1:44902] PHP Fatal error: Uncaught exception 'XPDF\\Exception\\InvalidArgumentException' with message 'sample.pdf is not a valid file' in /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php:133\nStack trace:\n#0 /var/www/html/PHP-XPDF/index.php(10): XPDF\\PdfToText->getText('sample.pdf')\n#1 {main}\n thrown in /var/www/html/PHP-XPDF/src/XPDF/PdfToText.php on line 133

@fabre-thibaud
Copy link
Contributor

Can you post the output of the following commands:

ls -la /usr/bin/pdftotext
ls -la /opt/local/xpdf/bin/pdftotext

@sagarguhe
Copy link
Author

output of ls -la /usr/bin/pdftotext:
-rwxr-xr-x 1 root root 26832 Apr 30 02:14 /usr/bin/pdftotext

and ls -la /opt/local/xpdf/bin/pdftotext:
ls: cannot access /opt/local/xpdf/bin/pdftotext: No such file or directory

@fabre-thibaud fabre-thibaud self-assigned this Aug 22, 2016
@ellej16
Copy link

ellej16 commented Nov 21, 2016

hi @sagarguhe , @aztech-dev ! Having no problems with the windows binary, but as some of my co-workers use linux/MacOS , can I have a gist on how and why this problem occurs?

Great library btw!

@dzona
Copy link

dzona commented Nov 14, 2019

@fabre-thibaud have you been able to fix? I'm having the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants