[Solved] libssh2

GOT

Well-Known Member
#1
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?
 

GOT

Well-Known Member
#5
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
 

GOT

Well-Known Member
#6
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.
 

GOT

Well-Known Member
#9
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.
 

GOT

Well-Known Member
#13
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
 

GOT

Well-Known Member
#15
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.
 

webizen

Well-Known Member
#16
"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).
 

GOT

Well-Known Member
#17
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
 

webizen

Well-Known Member
#18
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
1. cd ssh2-0.11.2
2. make clean
3. /usr/local/lsws/lsphp5/bin/phpize
4. ./configure --with-php-config=/usr/local/lsws/lsphp5/bin/php-config
5. make
6. make install
7. service lsws restart
 
Top