The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Error installing PHP PECL

Discussion in 'General Discussion' started by JanE182098109, Jun 28, 2016.

Tags:
  1. JanE182098109

    JanE182098109 Member

    Joined:
    Jun 28, 2016
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Hi. I have a cPanel powered server CentOS 6.8 X86_64 standard WHM 56.0. (build 24) with PHP 5.6.20

    After successfully installing Libsodium via
    yum install libsodium

    I tried to install PHP extension PECL Libsodium via WHM -> Module installers ->PECL

    but no luck. I also tried this via ssh (pecl install libsodium), but ended up with same error.

    Below is the output by WHM, errors bolded by me. Any ideas as what's wrong with this box and how to fix it?
    Code:
    Installing PHP Pecl "libsodium"
    downloading libsodium-1.0.6.tgz ...
    Starting to download libsodium-1.0.6.tgz (169,817 bytes)
    .....................................done: 169,817 bytes
    9 source files, building
    running: phpize
    Configuring for:
    PHP Api Version:         20131106
    Zend Module Api No:      20131226
    Zend Extension Api No:   220131226
    building in /root/tmp/pear/pear-build-rootr8RevY/libsodium-1.0.6
    running: /root/tmp/pear/libsodium/configure --with-php-config=/usr/local/bin/php-config
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for a sed that does not truncate output... /bin/sed
    checking for cc... cc
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether cc accepts -g... yes
    checking for cc option to accept ISO C89... none needed
    checking how to run the C preprocessor... cc -E
    checking for icc... no
    checking for suncc... no
    checking whether cc understands -c and -o together... yes
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for PHP prefix... /usr/local
    checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
    checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20131226
    checking for PHP installed headers prefix... /usr/local/include/php
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for re2c... no
    configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
    checking for gawk... gawk
    checking for libsodium support... yes, shared
    checking for libsodium files in default path... found in /usr
    checking for crypto_pwhash_scryptsalsa208sha256 in -lsodium... no
    configure: error: wrong libsodium lib version or lib not found
    ERROR: `/root/tmp/pear/libsodium/configure --with-php-config=/usr/local/bin/php-config' failed
    The libsodium.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20131226
    Tidying /usr/local/lib/php.ini...
    No changes
    Tidying /usr/local/cpanel/3rdparty/php/54/etc/php.ini...
    No changes
    
    
     
    #1 JanE182098109, Jun 28, 2016
    Last edited by a moderator: Jun 28, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,787
    Likes Received:
    665
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Verify the "libsodium-devel" package is installed on your system and then try installing the PECL module again:

    Code:
    yum install libsodium-devel
    Thanks!
     
  3. JanE182098109

    JanE182098109 Member

    Joined:
    Jun 28, 2016
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Hello. Thank you for your reply.

    My apologies, I typed incorrectly on my opening post. I actually did do yum install libsodium-devel, which installs libsodium as dependency.
    Verified and have these installed: libsodium-devel-0.4.5-3.el6.x86_64 and libsodium-0.4.5-3.el6.x86_64

    I wonder is there a way to try to install a different version of libsodium or pecl libsodium?
    PECL :: Package :: libsodium
    Maybe this is some incompatibility issue?

    One error (configure: error: wrong libsodium lib version or lib not found)

    refers to situation I found here:
    github.com/jedisct1/libsodium-php/blob/master/config.m4
    (line 37)

    Just a guess, I have no idea what's wrong.
     
    #3 JanE182098109, Jun 29, 2016
    Last edited by a moderator: Jun 29, 2016
  4. JanE182098109

    JanE182098109 Member

    Joined:
    Jun 28, 2016
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Update:

    I tried this (found on: stackoverflow.com/questions/36705155/trouble-installing-libsodium-on-centos-6)
    yum --enablerepo=remi install php-pecl-libsodium
    Error getting repository data for remi, repository not found

    I don't know if enabling remi repo can mess up with cPanel/server updates, so I have not enabled it.

    @cPanelMichael, can I install remi safely so that I could try the command above? Or is there some other, perhaps more appropriate way of trying this?
     
    #4 JanE182098109, Jun 29, 2016
    Last edited by a moderator: Jun 29, 2016
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,787
    Likes Received:
    665
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    You could try manually compiling the library before installing a custom YUM repo. The instructions on github.com/jedisct1/libsodium suggest running the following commands:

    Code:
    cd /usr/src
    git clone https://github.com/jedisct1/libsodium
    cd libsodium
    ./autogen.sh
    Thank you.
     
  6. JanE182098109

    JanE182098109 Member

    Joined:
    Jun 28, 2016
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Hi. Thank you, I appreciate it.

    I already did that on another (non-production) server, but the extension does not load. This time the error was:
    Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/libsodium.so' - /usr/lib64/php/modules/libsodium.so: undefined symbol: crypto_pwhash_memlimit_sensitive in Unknown on line 0

    I think I might try compiling both libsodium(libsodium.org/) and the php-extension (github.com/jedisct1/libsodium) from source(s) with latest versions and see what happens.
     
    #6 JanE182098109, Jul 6, 2016
    Last edited by a moderator: Jul 6, 2016
  7. yatesf

    yatesf Member

    Joined:
    Sep 28, 2013
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Did this work for you? If not, did you find another way to get it to work? I'm having the exact same errors you described.
     
  8. JanE182098109

    JanE182098109 Member

    Joined:
    Jun 28, 2016
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    I did not go that far. I gave up on libsodium, because I found another solution that met my needs for encryption. We only have one cPanel server, and it's a production server with customers on so I could not test things further. Sorry.

    If you manage to get things working, please post your solution here.
     
  9. yatesf

    yatesf Member

    Joined:
    Sep 28, 2013
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Code:
    yum install libsodium-devel
    In my case, the above yum command did not install all of the correct ".h" crypto include files that were needed in order for the PECL extension to pass it's initial checks for proper installation. To be more specific, the assignment of LIBSYMBOL=crypto_pwhash_scryptsalsa208sha256 (on github.com/jedisct1/libsodium-php/blob/master/config.m4 line 30 of this config.m4 file) causes a false evaluation later in a dependency check because the file "crypto_pwhash_scryptsalsa208sha256.h" didn't exist in my /usr/include/sodium/ directory.

    So as my workaround, I installed the libsodium library manually from the latest available tarball instead (github.com/jedisct1/libsodium/releases v1.0.11). After that, all the latest ".h" crypto files were included in a /usr/local/include/sodium/ folder, thus causing the PECL extension installation check to pass. I was able to run the PECL extension installation successfully (I even ran my PECL extension installation from WHM via: Home » Software » Module Installers » PHP PECL Manage

    I rebooted Apache, and I was good to go. Hope this might help others who have the same install problem on a cPanel server.
     
    #9 yatesf, Sep 17, 2016
    Last edited by a moderator: Sep 17, 2016
  10. JanE182098109

    JanE182098109 Member

    Joined:
    Jun 28, 2016
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Ok, good to hear that you managed to get it working. Libsodium is a great library and I could use it in several other projects.
    We should have a development server with cPanel coming soon, so I am going to try this then.

    Thank you very much for sharing!
     
  11. yatesf

    yatesf Member

    Joined:
    Sep 28, 2013
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    You're very welcome. I really have to thank you though, because if it had not been for the identification of line 37 in that config.m4 file (above), I would have never taken the time to further trace the installation issue that I was experiencing, and I would have given up on libsodium and implemented a much weaker KDF into my hashing & encryption designs. That was just enough of a great starting point for me to find the motivation to pursue further.
     
    cPanelMichael likes this.
  12. JanE182098109

    JanE182098109 Member

    Joined:
    Jun 28, 2016
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Glad to hear that I had even some (eventhough extremely small, but "significant") :) part solving this problem.
    Great work and thanks again!
     
    cPanelMichael likes this.
Loading...

Share This Page