• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue sh: gs: command not found exporting files as pdf

rhand

Basic Pleskian
Was trying to export files as a pdf and had time outs after 3 minutes. Checked all PHP settings for max_execution time which is 300 seconds, max_input_time 300 seconds, post_max_size 60MB and upload_max_filesize 60MB. Started checking Nginx logs, Httpd logs, Proxy logs and so on. When I did check PHP logs I found this error

[08-Oct-2023 13:48:53] WARNING: [pool site.nl] child 699893 said into stderr: "sh: gs: command not found"
realized Ghost script was missing on my Alma Linux server so installed it
gs --version
bash: gs: command not found
# yum install ghostscript
Last metadata expiration check: 3:20:19 ago on Sun 08 Oct 2023 10:59:31 AM CEST.
Dependencies resolved.
======================================================================================================================
Package Architecture Version Repository Size
======================================================================================================================
Installing:
ghostscript x86_64 9.27-6.el8 appstream 82 k

Transaction Summary
======================================================================================================================
Install 1 Package

Total download size: 82 k
Installed size: 38 k
Is this ok [y/N]: y
Downloading Packages:
ghostscript-9.27-6.el8.x86_64.rpm 4.0 MB/s | 82 kB 00:00
----------------------------------------------------------------------------------------------------------------------
Total 180 kB/s | 82 kB 00:00
.....

Installed:
ghostscript-9.27-6.el8.x86_64
But still nothing. Export still fails in Wordpress using Fancy Product Designer. Also saw for PHP that Imagick was installed but when I did

convert --version
bash: convert: command not found
nothing was added. Then read I needed GraphicsMagick for Rhel though PHP had it already so installed it

dnf install GraphicsMagick GraphicsMagick-devel GraphicsMagick-perl
Last metadata expiration check: 3:25:42 ago on Sun 08 Oct 2023 10:59:31 AM CEST.
Dependencies resolved.
======================================================================================================================
Package Architecture Version Repository Size
======================================================================================================================
Installing:
GraphicsMagick x86_64 1.3.38-1.el8 epel 4.6 M
GraphicsMagick-devel x86_64 1.3.38-1.el8 epel 74 k
GraphicsMagick-perl x86_64 1.3.38-1.el8 epel 172 k

Transaction Summary
======================================================================================================================
Install 3 Packages

Total download size: 4.8 M
Installed size: 9.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): GraphicsMagick-perl-1.3.38-1.el8.x86_64.rpm 383 kB/s | 172 kB 00:00
(2/3): GraphicsMagick-devel-1.3.38-1.el8.x86_64.rpm 163 kB/s | 74 kB 00:00
(3/3): GraphicsMagick-1.3.38-1.el8.x86_64.rpm 4.0 MB/s | 4.6 MB 00:01
----------------------------------------------------------------------------------------------------------------------
Total 3.1 MB/s | 4.8 MB 00:01
....

Complete!

...
But I probably do not need it and it does not include Ghost anyways:

gm --version
gm: Unrecognized command '-version'. Use -help for a usage summary or see manual..
[root@snaakbeheer snaakontwerp.nl]# gm version
GraphicsMagick 1.3.38 2022-03-26 Q16 GraphicsMagick Image Processing System
Copyright (C) 2002-2022 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See GraphicsMagick Copyrights and Licenses for details.

Feature Support:
Native Thread Safe yes
Large Files (> 32 bit) yes
Large Memory (> 32 bit) yes
BZIP yes
DPS no
FlashPix no
FreeType yes
Ghostscript (Library) no
HEIF/HVEC ("HEIC") no
JBIG yes
JPEG-2000 yes
JPEG yes
JPEG XL no
Little CMS yes
Loadable Modules yes
Solaris mtmalloc no
Google perftools tcmalloc no
OpenMP yes (201511 "4.5")
PNG yes
TIFF yes
TRIO no
Solaris umem no
WebP yes
WMF yes
X11 yes
XML yes
ZLIB yes
...
How can I get the Plesk installed PHP FPM 8.0.3 to find Ghost and work with it well so the plugin can generate the pdf files?
 
By the way Imagick is working for PHP FPM already . Its ini is loaded and 3.7.0 shows in PHP Info
cat /opt/plesk/php/8.0/etc/php.d/imagick.ini
; Enable imagick extension module
extension=imagick.so
 
I could do

export GS_LIB=/usr/share/ghostscript/lib
or add it to the main web users's .bashrc perhaps, but sounds like an odd way to do this. On shared hosts this was never necessary. Hope someone on this forum has a better idea to have PHP Imagick play nice with Ghostscript I just installed today to allow for PDF exports using a WordPress plugin.
 
Software installed on your server cannot be accessed when you are using the chrooted shell setting in a subscription, because there, the subscription user is limited to its own webspace. Changing that to a regular shell with "all access" pass poses huge security risks. If you want to add a program to your subscription shell, please follow this guide: https://support.plesk.com/hc/en-us/...chrooted-shell-environment-template-in-Plesk- . As an alternative, you could consider to install this PECL extension https://pecl.php.net/package/ps to create PostScript files. You can do that with the PECL install button from the admin's PHP control page in Tools & Settings.
 
Did not realize or think about the fact that each subscription is chrooted. That certainly causes the Ghostscript binary to not be available even after I installed it on the server as root. Also explains why I did not locate Imagick. Thanks @Peter Debik for telling me about it. Will not want to break out of the chroot env. Will check out adding a program in shell environment at a later stage. I tried to install the PECL package but it failed

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading ps-1.4.4.tgz ...
Starting to download ps-1.4.4.tgz (637,247 bytes)
..............................................checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /opt/plesk/php/8.0
checking for PHP includes... -I/opt/plesk/php/8.0/include/php -I/opt/plesk/php/8.0/include/php/main -I/opt/plesk/php/8.0/include/php/TSRM -I/opt/plesk/php/8.0/include/php/Zend -I/opt/plesk/php/8.0/include/php/ext -I/opt/plesk/php/8.0/include/php/ext/date/lib
checking for PHP extension directory... /opt/plesk/php/8.0/lib64/php/modules
checking for PHP installed headers prefix... /opt/plesk/php/8.0/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for ps support... yes, shared
checking for pkg-config... /bin/pkg-config
checking for libps... configure: error: cannot find libps using pkg-config (0.4.0 or later recommended)
ERROR: `/tmp/ps/configure --with-php-config=/opt/plesk/php/8.0/bin/php-config --with-ps=' failed

Seems protocols have been updated. Should I run
pecl channel-update pecl.php.net

as root or is there a Plesk way to deal with this issue?
 
pecl channel-update pecl.php.net
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded

than I tried to install ps PECL package again and had

checking for ps support... yes, shared
checking for pkg-config... /bin/pkg-config
checking for libps... configure: error: cannot find libps using pkg-config (0.4.0 or later recommended)
ERROR: `/tmp/ps/configure --with-php-config=/opt/plesk/php/8.0/bin/php-config --with-ps=' failed
 
Not sure why it cannot find libps as we tried installing it and it downloaded things
downloading ps-1.4.4.tgz ...
Starting to download ps-1.4.4.tgz (637,247 bytes)
.........................................checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /opt/plesk/php/8.0
checking for PHP includes... -I/opt/plesk/php/8.0/include/php -I/opt/plesk/php/8.0/include/php/main -I/opt/plesk/php/8.0/include/php/TSRM -I/opt/plesk/php/8.0/include/php/Zend -I/opt/plesk/php/8.0/include/php/ext -I/opt/plesk/php/8.0/include/php/ext/date/lib
checking for PHP extension directory... /opt/plesk/php/8.0/lib64/php/modules
checking for PHP installed headers prefix... /opt/plesk/php/8.0/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for ps support... yes, shared
checking for pkg-config... /bin/pkg-config
checking for libps... configure: error: cannot find libps using pkg-config (0.4.0 or later recommended)
ERROR: `/tmp/ps/configure --with-php-config=/opt/plesk/php/8.0/bin/php-config --with-ps=' failed


when I check extensions I do not see it now, but also not Imagick.. but perhaps elsewhere and only for chrooted subscriptions?

/opt/plesk/php/8.0/include/php/ext
[root@snaakbeheer ext]# ll
total 20
drwxr-xr-x. 2 root root 24 Oct 9 09:16 curl
drwxr-xr-x. 3 root root 35 Oct 9 09:16 date
drwxr-xr-x. 2 root root 26 Oct 9 09:16 dom
drwxr-xr-x. 2 root root 26 Oct 9 09:16 filter
drwxr-xr-x. 3 root root 74 Oct 9 09:16 gd
drwxr-xr-x. 2 root root 27 Oct 9 09:16 gmp
drwxr-xr-x. 2 root root 4096 Oct 9 09:16 hash
drwxr-xr-x. 2 root root 48 Oct 9 09:16 iconv
drwxr-xr-x. 2 root root 75 Oct 9 09:16 json
drwxr-xr-x. 2 root root 26 Oct 9 09:16 libxml
drwxr-xr-x. 3 root root 85 Oct 9 09:16 mbstring
drwxr-xr-x. 2 root root 58 Oct 9 09:16 mysqli
drwxr-xr-x. 2 root root 4096 Oct 9 09:16 mysqlnd
drwxr-xr-x. 3 root root 40 Oct 9 09:16 pcre
drwxr-xr-x. 2 root root 70 Oct 9 09:16 pdo
drwxr-xr-x. 2 root root 24 Oct 9 09:16 phar
drwxr-xr-x. 2 root root 64 Oct 9 09:16 session
drwxr-xr-x. 2 root root 60 Oct 9 09:16 simplexml
drwxr-xr-x. 2 root root 27 Oct 9 09:16 sockets
drwxr-xr-x. 2 root root 4096 Oct 9 09:16 spl
drwxr-xr-x. 2 root root 4096 Oct 9 09:16 standard
drwxr-xr-x. 2 root root 66 Oct 9 09:16 xml
 
Last extension list was not PECL though.. was PHP.. so is different. Issue with not finding libps installing PS PECL package still remains.
 
Still errors

Failed to install PHP extension 'ps':
downloading ps-1.4.4.tgz ...
Starting to download ps-1.4.4.tgz (637,247 bytes)
..................................................checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /opt/plesk/php/8.0
checking for PHP includes... -I/opt/plesk/php/8.0/include/php -I/opt/plesk/php/8.0/include/php/main -I/opt/plesk/php/8.0/include/php/TSRM -I/opt/plesk/php/8.0/include/php/Zend -I/opt/plesk/php/8.0/include/php/ext -I/opt/plesk/php/8.0/include/php/ext/date/lib
checking for PHP extension directory... /opt/plesk/php/8.0/lib64/php/modules
checking for PHP installed headers prefix... /opt/plesk/php/8.0/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for ps support... yes, shared
checking for pkg-config... /bin/pkg-config
checking for libps... configure: error: cannot find libps using pkg-config (0.4.0 or later recommended)
ERROR: `/tmp/ps/configure --with-php-config=/opt/plesk/php/8.0/bin/php-config --with-ps=' failed

may open an official support ticket soon. Just to export pdfs is getting rather tedious.
 
Not all PECL extensions can be installed through the PECL installer, because some just don't behave as expected by such an extension. Maybe this is one of them. You could install the extension manually. You could also open a support ticket with Plesk support to get better individual assistance as you can let them access your server if you prefer.
 
When I tried it from the command line using the chrooted user for the domain name I got this

pecl install ps
WARNING: configuration download directory "/tmp/pear/download" is not writeable. Change download_dir config variable to a writeable dir to avoid this warning
Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user
so that explains something. Not sure why Plesk said it up this way, but will see how we can remedy that the best way.
 
ll /tmp/pear/download
total 628
-rw-r--r--. 1 root root 648 Oct 9 09:16 channel.xml
-rw-r--r--. 1 root root 637247 Oct 9 12:35 ps-1.4.4.tgz

perhaps I need to use sudo... no.. I can only change to root using su as user is chrooted. So not sure how pecl install ps and have it work for the chrooted user and its chosen PHP FPM 8.0 . Also.. so earlier trial to add PS today did work.. and that was from Plesk.. so not sure why it stated

Failed to install the ps package on the 8.0.30 FPM application PHP handler
  • Failed to install PHP extension 'ps':
  • downloading ps-1.4.4.tgz ...
  • Starting to download ps-1.4.4.tgz (637,247 bytes)
  • ..................................................checking build system type... x86_64-pc-linux-gnu
  • checking host system type... x86_64-pc-linux-gnu
  • checking target system type... x86_64-pc-linux-gnu
  • checking for PHP prefix... /opt/plesk/php/8.0
  • checking for PHP includes... -I/opt/plesk/php/8.0/include/php -I/opt/plesk/php/8.0/include/php/main -I/opt/plesk/php/8.0/include/php/TSRM -I/opt/plesk/php/8.0/include/php/Zend -I/opt/plesk/php/8.0/include/php/ext -I/opt/plesk/php/8.0/include/php/ext/date/lib
  • checking for PHP extension directory... /opt/plesk/php/8.0/lib64/php/modules
  • checking for PHP installed headers prefix... /opt/plesk/php/8.0/include/php
before..
 
So why

checking for libps... configure: error: cannot find libps using pkg-config (0.4.0 or later recommended)
I mean we do have on the installation installation through Plesk:

ll /tmp/pear/download
total 628
-rw-r--r--. 1 root root 648 Oct 9 09:16 channel.xml
-rw-r--r--. 1 root root 637247 Oct 9 12:35 ps-1.4.4.tgz
must be a path issue. But perhaps I need to run installation command as root? But how to make sure it is for chrooted subscriber and its PHP FPM 8.0.30?
 
Get to hear that license works but is via provider and that I cannot ask questions directly


We identified that the Plesk license was purchased not directly from Plesk but through one of the Plesk Resellers.
 
Was trying to export files as a pdf and had time outs after 3 minutes. Checked all PHP settings for max_execution time which is 300 seconds, max_input_time 300 seconds, post_max_size 60MB and upload_max_filesize 60MB. Started checking Nginx logs, Httpd logs, Proxy logs and so on. When I did check PHP logs I found this error


realized Ghost script was missing on my Alma Linux server so installed it

But still nothing. Export still fails in Wordpress using Fancy Product Designer. Also saw for PHP that Imagick was installed but when I did


nothing was added. Then read I needed GraphicsMagick for Rhel though PHP had it already so installed it


But I probably do not need it and it does not include Ghost anyways:


How can I get the Plesk installed PHP FPM 8.0.3 to find Ghost and work with it well so the plugin can generate the pdf files?
En la economía digital actual, la rapidez, la seguridad y la precisión son fundamentales en las transacciones. En este contexto, PayPal, el líder mundial en pagos en línea, desempeña un papel crucial. Sin embargo, para optimizar el uso de esta herramienta poderosa, es esencial comprender su programación de tarifas. En este sentido, la Calculadora de Tarifas de PayPal se convierte en tu aliada más útil.

https://payplcalculadora.com/calculadora-taxa-paypal/
Hi, I just installed Imagemagick to a newly formatted server and tried running the following convert command with Imagemagick.

PHP Code:
Code:
/usr/local/bin/convert -pointsize 18 -gravity "Center" -draw 'text 0,0 "634669"' /home/public_html/images/canvas.png /home/public_html/images/botcode/25d0623b4c3136dc8cc4b9f28deb2292.png
sh: gs: command not found
sh: gs: command not found
convert: no decode delegate for this image format `/tmp/magick-XXLEhTir'.
sh: gs: command not found
sh: gs: command not found
convert: no decode delegate for this image format `/tmp/magick-XXBR5ph8'.
I've googled for this error (sh: gs: command not found) and I think is something related to Ghostscript not being install on my server. How do I get around this issue? I can't find any step by step guide on how to install Ghostscript
frown.gif
 
It seems to be very difficult to get PDF export to work on a chrooted Plesk environment and it Ghostscript or Postscript PS PECL package is not installed any default and installing fails with default setup. Plesk has responded and I was told to update Chrooted env and add the program with mention that it will still not work for all programs . Hear their reaction. Do notice as we only have one user they recommended to allow /bin/bash access to all chrooted envs:

to me it appears its the only customer on the server, if the issue is caused by not being able to properly install it on chrooted environment why not provide /bin/bash access for the domains?

Alternatively please reset the chrooted environment as described here:
https://support.plesk.com/hc/en-us/...build-chroot-template-on-a-server-with-Plesk-

Then you can install PECL for PHP8 which is currently set for the domain by following the instructions here:
Go to **Tools & Settings > PHP Settings >** _**click_on_the_PHP version**_ **> Manage PECL packages**;
Choose the required package from the list and install it. Or if the package is not present in the list click **Install package** and proceed with installation.

And add whatever is required to the chrooted environment:
https://support.plesk.com/hc/en-us/...chrooted-shell-environment-template-in-Plesk-

Please note that the software thats being tried to be installed is not supported by plesk hence we have no knowledge about the installation process itself. You can make sure that its not about the software by adding another software to chroot i.e.:
https://support.plesk.com/hc/en-us/...-Composer-to-a-chrooted-environment-in-Plesk-
Step by step explanation how to have PHP PECL package Imagick work with pdf export using Ghostscript or PS PECL package has not been given.
 
Back
Top