[Solved] libssh2

Discussion in 'Install/Configuration' started by GOT, May 1, 2011.

  1. GOT

    GOT Member

    I downloaded and compiled the ssh2 extension from pecl. It compiled fine and I have an ssh2.so. I added it to the php.ini, but its not showing up in phpinfo(). Any ideas?
  2. NiteWave

    NiteWave Administrator

  3. GOT

    GOT Member

    Thanks for that. But the link is for php opcode cache, not ssh2...
  4. NiteWave

    NiteWave Administrator

    yes, that's opcode cache. but the build way is same.
  5. GOT

    GOT Member

    I did try this:

    ./configure --with-php-config=/php5install/php5/bin/php-config

    however, that just gets me a

    ./configure: line 2950: /php5install/php5/bin/php-config: No such file or directory
    ./configure: line 2951: /php5install/php5/bin/php-config: No such file or directory
    configure: error: Cannot find php-config. Please use --with-php-config=PATH
  6. GOT

    GOT Member

    This configures

    ./configure --with-php-config=/usr/local/lsws/lsphp5/bin/php-config

    however, there are no changes to my configuration when i do that.

    I reinstalled the file, however, its teh same thing, nothing in phpinfo.
  7. GOT

    GOT Member

    Any ideas?
  8. webizen

    webizen New Member

    add line 'extension=ssh2.so' to your php.ini and restart lsws.
  9. GOT

    GOT Member

    Yes, we have had that since the start. Both just the ssh2.so and with the absolute path to the file. No go either way.
  10. webizen

    webizen New Member

    does ssh2.so exist on the absolute path or the path to extension_dir?
  11. GOT

    GOT Member

    It does, yes, which is why i am so perplexed.
  12. webizen

    webizen New Member

    is the loaded php.ini (result of below) the same one in use?
  13. GOT

    GOT Member

    Its using the right php.ini. I'm not sure what ./ folder represents with this php implementation, however, Using teh cli php, I am seeing this error:

    PHP Warning: PHP Startup: ssh2: Unable to initialize module
  14. webizen

    webizen New Member

    Can you elaborate this? What "./" folder are you referring to? extension_dir?
  15. GOT

    GOT Member

    Correct, extension_dir is set to ./ which is current folder. I don't know what php would consider the current folder.

    But in any case, when its referenced directly, it gives the error in my last message.
  16. webizen

    webizen New Member

    "extension_dir = ./" means the current directory of referring file (php.ini). you can change to 'extension_dir=/path/to/directory/holds/the/so/files' AND use 'extension=ssh2.so' instead of 'extension=/full/path/to/ssh2.so'.

    the warning message you posted indicates that ssh2.so is likely not for the running php binary. before you rebuild the so file, make sure to run 'make clean' to clean up old files. also make sure /usr/local/lsws/fcgi-bin/lsphp5 matches with /usr/local/lsws/lsphp5/bin/lsphp (php is the cli version).
  17. GOT

    GOT Member

    OK, well, I am totally confused now. Not even sure what you mean by match. Here is some output

    [root@yarow ~]# /usr/local/lsws/fcgi-bin/lsphp5 -v
    PHP Warning: PHP Startup: ssh2: Unable to initialize module
    Module compiled with module API=20050922, debug=0, thread-safety=0
    PHP compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
    in Unknown on line 0PHP 5.2.17 (litespeed) (built: Apr 28 2011 18:49:35)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with the ionCube PHP Loader v4.0.8, Copyright (c) 2002-2011, by ionCube Ltd., and
    with XCache v1.3.1, Copyright (c) 2005-2010, by mOo
    [root@yarow ~]# /usr/local/lsws/lsphp5/bin/lsphp -v
    PHP Warning: PHP Startup: ssh2: Unable to initialize module
    Module compiled with module API=20050922, debug=0, thread-safety=0
    PHP compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
    in Unknown on line 0PHP 5.2.17 (litespeed) (built: Apr 28 2011 18:49:35)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with the ionCube PHP Loader v4.0.8, Copyright (c) 2002-2011, by ionCube Ltd., and
    with XCache v1.3.1, Copyright (c) 2005-2010, by mOo
  18. webizen

    webizen New Member

    it is likely you compiled ssh2.so with phpize for a different php version before and you did not cleaned the old compiled files. hence so file was still for old php version.

    do this
  19. GOT

    GOT Member

    That did it. Eternal thanks!

Share This Page