PHP exec return openssl error

Problems with the Linux version of XAMPP, questions, comments, and anything related.

PHP exec return openssl error

Postby DMG » 25. January 2017 08:04

I want somehow from web access svn repository end get some data from it. I use XAMPP for Linux v5.6.28 (PHP 5.6.28) and tried to make svn.so, but I could not create it, because of openssl error. Now I' trying to call svn command with php exec, but still same error:
svn: relocation error: /usr/lib/x86_64-linux-gnu/libserf-1.so.1: symbol GENERAL_NAME_free, version OPENSSL_1.0.0 not defined in file libcrypto.so.1.0.0 with link time reference


PHP script I use:
Code: Select all
<?php
$output = shell_exec('svn info 2>&1');
print_r($output);
?>


If I change it to this:
Code: Select all
<?php
$output = shell_exec('openssl version 2>&1');
print_r($output);
?>


I get this error:
openssl: /opt/lampp/lib/libssl.so.1.0.0: version OPENSSL_1.0.1' not
found (required by openssl) openssl:
/opt/lampp/lib/libcrypto.so.1.0.0: versionOPENSSL_1.0.1' not found (required by openssl) openssl: /opt/lampp/lib/libcrypto.so.1.0.0: version `OPENSSL_1.0.2g' not found (required by openssl)


Everything works fine from console, but somehow not working from web. Any ideas, how to fix this in Ubuntu 16.04?
I have latest XAMPP version (5.6.28). Tested this in two Linux laptops with fresh XAMPP and Ubuntu and both has same error message.
DMG
 
Posts: 3
Joined: 25. January 2017 07:56
XAMPP version: 5.6.28
Operating System: Linux

Re: PHP exec return openssl error

Postby Nobbie » 25. January 2017 12:03

DMG wrote:Everything works fine from console, but somehow not working from web. Any ideas, how to fix this in Ubuntu 16.04?


From console, svn and everything else runs in your personal environment from your UserId (i.e. environment variables etc.). "From web" means, Apache executes the scripts (via PHP) and Apache runs in a different environment with a different UserID. You have to establish the same environment for Apache as for your UserID. You may run Apache with your own UserID (see "User = " and "Group = " in httpd.conf), but this also requires some rights/owners changes for some folders under /opt/lampp (htdocs etc.).
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: PHP exec return openssl error

Postby DMG » 25. January 2017 12:34

From web" means, Apache executes the scripts (via PHP) and Apache runs in a different environment with a different UserID.

Even if I execute it like this:
Code: Select all
/opt/lampp/bin/php svn.php

?

And it works even if I do this:
Code: Select all
sudo -s -u www-data
/opt/lampp/bin/php svn.php


From web it does not work even if I change user and group in httpd.conf. I created new linux user, changed user and group in httpd.conf and again same old ssl error.
DMG
 
Posts: 3
Joined: 25. January 2017 07:56
XAMPP version: 5.6.28
Operating System: Linux

Re: PHP exec return openssl error

Postby DMG » 25. January 2017 13:56

Finally it is working! I downloaded 5.6.20 version and everything just works. Ubuntu latest openssl version is OpenSSL 1.0.2g, so I guess ssl version must match with XAMPP ssl version or else it's not working.
DMG
 
Posts: 3
Joined: 25. January 2017 07:56
XAMPP version: 5.6.28
Operating System: Linux


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 22 guests