Friends4U

Member
Jan 20, 2005
18
2
153
Hello,

I want to have pdftotext on my CloudLinux server, my host installed it but it's not functioning...
I added poppler (it's part of that I believe) via:
cagefsctl --addrpm poppler

(that's the only thing I have executed)
But it's not working... Any idea?
 

Bazinga

Active Member
Verifed Vendor
Aug 23, 2016
32
7
8
Ukraine
cPanel Access Level
Website Owner
Hello,

I want to have pdftotext on my CloudLinux server, my host installed it but it's not functioning...
I added poppler (it's part of that I believe) via:
cagefsctl --addrpm poppler

(that's the only thing I have executed)
But it's not working... Any idea?

Hi,
After adding rpm you have to also run 'cagefsctl --force-update' to actually place a new files into filesystem template. However if it depends on some other libraries - most probably it will fails. If it is not working after 'cagefs --force-update' - try running it over strace to check what files are missing.
 

24x7server

Well-Known Member
Apr 17, 2013
1,912
99
78
India
cPanel Access Level
Root Administrator
Twitter
Hello :),

Also you can add custom file OR command in cagefs with the following steps.

Code:
nano /etc/cagefs/conf.d/custom.cfg
And add following code in this file.

Code:
[custom]
comment=custom paths
paths=/usr/local/bin/poppler
Once it's done, You need update cagefsctl on your server with the following command.

Code:
cagefsctl --force-update
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Yes, as mentioned, "cagefsctl --force-update" might help. Let us know if the issue continues.

Thanks!
 

Friends4U

Member
Jan 20, 2005
18
2
153
Hi,

I needed popler for PDFTOTEXT, this is installed now:

[email protected] [~]# which pdftotext
/usr/bin/pdftotext

So I added:

/etc/cagefs/conf.d/custom.cfg
[custom]
comment=custom paths
paths=/usr/bin/pdftotext

And run: cagefsctl --force-update


I Did not get errors but it did not work... My host tried to help me and got it working when I use the PHP selector, but I want to run the native PHP (because of other problems) but than pdftotext does not work :(


Sorry I did not reply earlier, I forget to make the topic watched... Now it is :)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Could you let us know us which steps you are taking to verify it's not working? Do you notice any output to the error_log file within the document root of the PHP script you are testing with?

Thank you.
 

Friends4U

Member
Jan 20, 2005
18
2
153
The piece of script (this was working before CloudLinux (other server)).

Code:
$pdl = @popen("which pdftotext 2>&1", "r");
        if ($pdl) {
          $this->pdftotext = fread($pdl, 1024);
          pclose($pdl);
        }
        if (!preg_match('/\/pdftotext$/',$this->pdftotext)) {
          echo "<div class='error'><b>pdftotext</b> is not available on your webserver. " . ($this->pdftotext ? "Server says: <i>" . $this->pdftotext . "</i>. " : "") . "<br />Please ask your hoster to make it available for you or deactivate \$collect_pdfs.</div>";
        $this->error = true;
        }
When I choose a custom PHP version it works (the hoster has done this for me, but he didn't know how to make it work on the native PHP version. No error log, it's handled in the script, the output is: pdftotext is not available on your webserver.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
When I choose a custom PHP version it works (the hoster has done this for me, but he didn't know how to make it work on the native PHP version. No error log, it's handled in the script, the output is: pdftotext is not available on your webserver.
Hello,

Do you have root access to this system? If so, please open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

Thank you.