Facing issues while converting PPT to PDF using headless mode.

I am trying to do using shell_exec(“soffice --headless --convert-to pdf --outdir /opt/lampp/htdocs/BlockChainProj/back-end/pdfs/ ppts/edited/1403_lkjhg.pptx”) in php.
But getting the following error.

/usr/lib/libreoffice/program/oosplash: /opt/lampp/lib/libz.so.1: version `ZLIB_1.2.9’ not found (required by /lib/x86_64-linux-gnu/libpng16.so.16)

Need help.
Plz help.

You obviously have system misconfigured, with requirements of libpng not met. This is not related to LibreOffice, which simply uses the libraries present on system.

Yes, you are correct I know this is not the issue of LibreOffice because when I run the Same command in Terminal it works fine.

I am now getting why isn’t this command running normally why does it have to go and look for stuff in lampp folder.