Page 1 of 1

Library Problem Calling External Program from PHP

PostPosted: 04. February 2018 04:23
by mikedombo
Hi,
I'm using XAMPP 7.2.1 x64 on Ubuntu Server 17.10 x64. I'm trying to migrate my website from xampp on Windows.

I am getting the following message "node: /opt/lampp/lib/libssl.so.1.0.0: version `OPENSSL_1.0.1' not found (required by node) node: /opt/lampp/lib/libcrypto.so.1.0.0: version `OPENSSL_1.0.1d' not found (required by node)" when calling "node --version" from php using shell_exec.

I had a previous error about libstdc++ which I was able to fix by copying that library from my /usr/lib into the /opt/lampp/lib. That worked with no issues, but when I do that with libssl and libcrypto the error message goes away, but xampp can no longer start.

I need a way to replace the /opt/lampp/lib libraries with updated versions or a way to get shell_exec in php to use the system libraries. The path LD_LIBRARY_PATH is set by xampp to /opt/lampp/lib, but I cannot find a way to disable this.

Any help would be appreciated, thanks!

Re: Library Problem Calling External Program from PHP

PostPosted: 04. February 2018 10:44
by Nobbie
The LD_LIBRARY_PATH and quite a lot more environment is setup in the startup shell script "xampp" (where "lampp" is a symbolic link to "xampp"). You may edit /opt/lampp/xampp and modify it to your needs.

Re: Library Problem Calling External Program from PHP

PostPosted: 04. February 2018 14:03
by mikedombo
I did try to edit the startup script, however the LD_LIBRARY_PATH was still set to /opt/lampp/lib even after restarting the server. I first edited it to add /usr/lib before it put in the xampp libraries and I then tried commenting out all the times it "exports" LD_LIBRARY_PATH, and again this did not work.

Re: Library Problem Calling External Program from PHP

PostPosted: 04. February 2018 22:43
by Nobbie
mikedombo wrote:I did try to edit the startup script, however the LD_LIBRARY_PATH was still set to /opt/lampp/lib even after restarting the server. I first edited it to add /usr/lib before it put in the xampp libraries and I then tried commenting out all the times it "exports" LD_LIBRARY_PATH, and again this did not work.


For test reason, i simply started httpd plainly, opened a terminal, cd into /opt/lampp/bin and started httpd directly via "sudo ./httpd". I loaded localhost into the browser and did run a phpinfo(). In the environment section was no LD_LIBRARY_PATH. Everything as expected.