Ghostscript error while trying to read PDF file using Imagick package in Laravel
Laravel version is 8
Below is the Laravel code->
$imgExtension = new Imagick();
$imgExtension-
$imgExtension-
Below error is seen in the Apache error logs for the 3rd line ->
gs: /opt/lampp/
gs: symbol lookup error: /usr/lib/
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
"/opt/lampp/
The Ubuntu-provided version is /usr/lib/
For diagnostic purposes please provide the output that you receive for the commands
uname -a
lsb_release -crid
apt-cache policy libtiff5 libgs9 libfreetype6 ghostscript
ls -l /usr/lib/
ls -l /opt/lampp/
which gs
ldd /usr/bin/gs
Revision history for this message
|
#2 |
Linux fast 4.15.0-147-generic #151-Ubuntu SMP Fri Jun 18 19:21:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
libtiff5:
Installed: 4.0.9-5ubuntu0.4
Candidate: 4.0.9-5ubuntu0.4
Version table:
*** 4.0.9-5ubuntu0.4 500
500 http://
500 http://
100 /var/lib/
4.0.9-5 500
500 http://
libgs9:
Installed: 9.26~dfsg+
Candidate: 9.26~dfsg+
Version table:
*** 9.26~dfsg+
500 http://
500 http://
100 /var/lib/
9.
500 http://
libfreetype6:
Installed: 2.8.1-2ubuntu2.1
Candidate: 2.8.1-2ubuntu2.1
Version table:
*** 2.8.1-2ubuntu2.1 500
500 http://
500 http://
100 /var/lib/
2.8.1-2ubuntu2 500
500 http://
ghostscript:
Installed: 9.26~dfsg+
Candidate: 9.26~dfsg+
Version table:
*** 9.26~dfsg+
500 http://
500 http://
100 /var/lib/
9.
500 http://
lrwxrwxrwx 1 root root 16 Feb 25 18:07 /usr/lib/
lrwxrwxrwx 1 root root 16 Jan 29 2021 /opt/lampp/
which gs->
ldd /usr/bin/gs->
linux-vdso.so.1 (0x00007ffc4584
libgs.so.9 => /usr/lib/
libc.so.6 => /lib/x86_
libtiff.so.5 => /usr/lib/
libcupsimage.so.2 => /usr/lib/
libcups.so.2 => /usr/lib/
libijs-0.35.so => /usr/lib/
libpng16.so.16 => /usr/lib/
libjbig2dec.so.0 => /usr/lib/
libjpeg.so.8 => /usr/lib/
libz.so.1 => /lib/x86_
liblcms2.so.2 => /usr/lib/
libm.so.6 => /lib/x86_
libdl.so.2 => /lib/x86_
libidn.so.11 => /lib/x86_
libpaper.so.1 => /usr/lib/
libfontconfig.so.1 => /usr/lib/
libfreetype.so.6 => /usr/lib/
libpthread.so.0 => /lib/x86_
/lib64/
liblzma.so.5 => /lib/x86_
libjbig.so.0 => /usr/lib/
libgssapi_
libgnutls.so.30 => /usr/lib/
libavahi-
libavahi-
libexpat.so.1 => /lib/x86_
libkrb5.so.3 => /usr/lib/
libk5crypto.so.3 => /usr/lib/
libcom_err.so.2 => /lib/x86_
libkrb5support
libp11-kit.so.0 => /usr/lib/
libidn2.so.0 => /usr/lib/
libunistring.so.2 => /usr/lib/
libtasn1.so.6 => /usr/lib/
libnettle.so.6 => /usr/lib/
libhogweed.so.4 => /usr/lib/
libgmp.so.10 => /usr/lib/
libdbus-1.so.3 => /lib/x86_
libkeyutils.so.1 => /lib/x86_
libresolv.so.2 => /lib/x86_
libffi.so.6 => /usr/lib/
libsystemd.so.0 => /lib/x86_
librt.so.1 => /lib/x86_
liblz4.so.1 => /usr/lib/
libgcrypt.so.20 => /lib/x86_
libgpg-error.so.0 => /lib/x86_
Revision history for this message
|
#3 |
You are also using a foreign version of gs (ghostscript)
What is the output of the commands
ls -l /usr/bin/gs
ls -l /usr/local/sbin/gs
ldd /usr/local/sbin/gs
Revision history for this message
|
#4 |
-rwxr-xr-x 1 root root 10232 Jan 6 2021 /usr/bin/gs
lrwxrwxrwx 1 root root 11 Aug 3 20:09 /usr/local/sbin/gs -> /usr/bin/gs
linux-vdso.so.1 (0x00007fff5257
libgs.so.9 => /usr/lib/
libc.so.6 => /lib/x86_
libtiff.so.5 => /usr/lib/
libcupsimage.so.2 => /usr/lib/
libcups.so.2 => /usr/lib/
libijs-0.35.so => /usr/lib/
libpng16.so.16 => /usr/lib/
libjbig2dec.so.0 => /usr/lib/
libjpeg.so.8 => /usr/lib/
libz.so.1 => /lib/x86_
liblcms2.so.2 => /usr/lib/
libm.so.6 => /lib/x86_
libdl.so.2 => /lib/x86_
libidn.so.11 => /lib/x86_
libpaper.so.1 => /usr/lib/
libfontconfig.so.1 => /usr/lib/
libfreetype.so.6 => /usr/lib/
libpthread.so.0 => /lib/x86_
/lib64/
liblzma.so.5 => /lib/x86_
libjbig.so.0 => /usr/lib/
libgssapi_
libgnutls.so.30 => /usr/lib/
libavahi-
libavahi-
libexpat.so.1 => /lib/x86_
libkrb5.so.3 => /usr/lib/
libk5crypto.so.3 => /usr/lib/
libcom_err.so.2 => /lib/x86_
libkrb5support
libp11-kit.so.0 => /usr/lib/
libidn2.so.0 => /usr/lib/
libunistring.so.2 => /usr/lib/
libtasn1.so.6 => /usr/lib/
libnettle.so.6 => /usr/lib/
libhogweed.so.4 => /usr/lib/
libgmp.so.10 => /usr/lib/
libdbus-1.so.3 => /lib/x86_
libkeyutils.so.1 => /lib/x86_
libresolv.so.2 => /lib/x86_
libffi.so.6 => /usr/lib/
libsystemd.so.0 => /lib/x86_
librt.so.1 => /lib/x86_
liblz4.so.1 => /usr/lib/
libgcrypt.so.20 => /lib/x86_
libgpg-error.so.0 => /lib/x86_
Revision history for this message
|
#5 |
This is now a bit unexpected. In the output of the commands, there is no reference to the files that are listed in the error messages in your original question.
In any case, the cause seems to be duplicate libraries in different versions in different directories.
Looking at the output
lrwxrwxrwx 1 root root 16 Feb 25 18:07 /usr/lib/
lrwxrwxrwx 1 root root 16 Jan 29 2021 /opt/lampp/
you should consider removing library files that are in /opt/lampp/lib in a lower version than in /usr/lib/
Revision history for this message
|
#6 |
I think the XAMPP server is taking the files from /opt/lampp folder.
How to remove the the library files from /opt/lampp ?
Revision history for this message
|
#7 |
If I directly remove from "rm" command then will it work ?
Revision history for this message
|
#8 |
I do not know how the files were installed in the /opt/lampp directory, but I guess that simply removing them should work.
Can you help with this problem?
Provide an answer of your own, or ask Pankaj S Y for more information if necessary.