• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Binary (wkhtmltopdf) not found / executable

Primate

New Pleskian
Hello, good morning.
I have a problem with a system plugin that I am not able to use in a web; The plugin is wkhtmltopdf, which is saved in /usr/bin/wkhtmltopdf but from the web I don't have access. It is worth mentioning that this website was fully functional before migrating it to the new server with plesk. I have tried to change the permissions in that folder, and even to put it in another one with chmod 777.

Error returned by cakePhp:
is_executable(): open_basedir restriction in effect. File(/usr/bin/wkhtmltopdf) is not within the allowed path(s): (/var/www/vhosts/my_domain/:/tmp/) [ROOT/vendor/friendsofcake/cakepdf/src/Pdf/Engine/WkHtmlToPdfEngine.php, line 110]

wkhtmltopdf binary is not found or not executable: /usr/bin/wkhtmltopdf
I think that I'm missing something, Help T_T (I'm new with plesk)
 
Hello, good morning.
I have a problem with a system plugin that I am not able to use in a web; The plugin is wkhtmltopdf, which is saved in /usr/bin/wkhtmltopdf but from the web I don't have access. It is worth mentioning that this website was fully functional before migrating it to the new server with plesk. I have tried to change the permissions in that folder, and even to put it in another one with chmod 777.

Error returned by cakePhp:
is_executable(): open_basedir restriction in effect. File(/usr/bin/wkhtmltopdf) is not within the allowed path(s): (/var/www/vhosts/my_domain/:/tmp/) [ROOT/vendor/friendsofcake/cakepdf/src/Pdf/Engine/WkHtmlToPdfEngine.php, line 110]

wkhtmltopdf binary is not found or not executable: /usr/bin/wkhtmltopdf
I think that I'm missing something, Help T_T (I'm new with plesk)
you have clearly an open_basedir problem... your authorized path for this domain are /var/www/vhosts/my_domain/:/tmp/ (that is the normal path) and you are trying to access to an outside binary path. You must change your openbasedir or disable it, in anycase, it's very dangerous to give to an website, the ability to access to this binary directory!!!! You must understand what you are doing before.
 
you have clearly an open_basedir problem... your authorized path for this domain are /var/www/vhosts/my_domain/:/tmp/ (that is the normal path) and you are trying to access to an outside binary path. You must change your openbasedir or disable it, in anycase, it's very dangerous to give to an website, the ability to access to this binary directory!!!! You must understand what you are doing before.

but I copied the binary in / var / www / vhosts / my_domain / tmp /bin
and have the same problem

wkhtmltopdf binary is not found or not executable
 
i put de binary in
/var/www/vhosts/mydomain.es/tmp/bin
to solve :
Error returned by cakePhp:
is_executable(): open_basedir restriction in effect. File(/usr/bin/wkhtmltopdf) is not within the allowed path(s): (/var/www/vhosts/my_domain/:/tmp/) [ROOT/vendor/friendsofcake/cakepdf/src/Pdf/Engine/WkHtmlToPdfEngine.php, line 110]

then
I tried with
'binary' => 'bin/wkhtmltopdf',
'binary' => '/bin/wkhtmltopdf',
'binary' => 'tmp/bin/wkhtmltopdf',
'binary' => '/tmp/bin/wkhtmltopdf',



i tried with this 2 option :
{DOCROOT}{/}{:}{TMP}{/}
{WEBSPACEROOT}{/}{:}{TMP}{/}

only worked with option none and the path :

'binary' => '/usr/local/bin/wkhtmltopdf';
 
i put de binary in
/var/www/vhosts/mydomain.es/tmp/bin
to solve :
Error returned by cakePhp:
is_executable(): open_basedir restriction in effect. File(/usr/bin/wkhtmltopdf) is not within the allowed path(s): (/var/www/vhosts/my_domain/:/tmp/) [ROOT/vendor/friendsofcake/cakepdf/src/Pdf/Engine/WkHtmlToPdfEngine.php, line 110]

then
I tried with
'binary' => 'bin/wkhtmltopdf',
'binary' => '/bin/wkhtmltopdf',
'binary' => 'tmp/bin/wkhtmltopdf',
'binary' => '/tmp/bin/wkhtmltopdf',



i tried with this 2 option :
{DOCROOT}{/}{:}{TMP}{/}
{WEBSPACEROOT}{/}{:}{TMP}{/}

only worked with option none and the path :

'binary' => '/usr/local/bin/wkhtmltopdf';
With correct /var/www/vhosts/my_domain/tmp/bin path, it should work as open_basedir include /var/www/vhosts/my_domain
 
With correct /var/www/vhosts/my_domain/tmp/bin path, it should work as open_basedir include /var/www/vhosts/my_domain
Thanks a lot, with the absolute path it works . (/var/www/vhosts/my_domain/tmp/bin)
and ($_SERVER["DOCUMENT_ROOT"].'/tmp/bin/wkhtmltopdf') works to.


I thought that script execution used the documentroot as root
 
Back
Top