php cli shows 5.1.6 vs phpinfo 5.2.9

SupermanInNY

Verified User
Joined
Sep 28, 2004
Messages
419
php cli shows 5.1.6 vs phpinfo 5.2.9+ ssh2-beta installation

[RESOLVED]

Hi All,

I've upgraded a client using customebuild to PHP 5.2.9 cli.

On phpinfo() I see 5.2.9.

But when I use the cmd line:

php -v

I see:

/usr/local/directadmin/custombuild # php -v
PHP 5.1.6 (cli) (built: Apr 7 2009 08:00:04)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies


I've rebuilt again, but to no avail.

I even deleted the symlink

rm /bin/php

but still it is back to the 5.1.6 version.
I'm confused and don't know how to get this resolved.

Any pointers?

-Alon.

thanks to smtalk:

rm -f /usr/bin/php
ln -s /usr/local/bin/php /usr/bin/php
ln -s /usr/local/bin/pecl /usr/bin/pecl


Now,. the next step is installing ssh2-beta:
lynx http://pecl.php.net/package/ssh2
extract the ssh2-0.11.0
cd ssh2-0.11.0
/usr/local/bin/phpize build/shtool

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

make
make install
 
Last edited:
The last steps to actually implement the the ssh2 extension requires you to continue with these steps:

After you've done the "make install" process, the system created ssh2.so file and tells you where it created it.
You need to copy that file to the extension_dir that is mentioned in the php.ini
and then restart apache.

Here are the actual steps:

Edit php.ini and look for the following:


; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"


I modified it to:

extension_dir = "/usr/local/lib/"


I then proceeded to add the inclusion line to load the ssh2 module.
The most proper place I came up is shown below:


;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here. Specify the location of the extension with the
; extension_dir directive above.

extension=ssh2.so

; Windows Extensions


-------------
Now save php.ini

I then did:

cp ssh2.so /usr/local/lib

Then I restarted apache and now it works fine.

Good luck.

-Alon.
 
The last steps to actually implement the the ssh2 extension requires you to continue with these steps:

After you've done the "make install" process, the system created ssh2.so file and tells you where it created it.
You need to copy that file to the extension_dir that is mentioned in the php.ini
and then restart apache.

Here are the actual steps:

Edit php.ini and look for the following:


; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"


I modified it to:

extension_dir = "/usr/local/lib/"


I then proceeded to add the inclusion line to load the ssh2 module.
The most proper place I came up is shown below:


;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here. Specify the location of the extension with the
; extension_dir directive above.

extension=ssh2.so

; Windows Extensions


-------------
Now save php.ini

I then did:

cp ssh2.so /usr/local/lib

Then I restarted apache and now it works fine.

Good luck.

-Alon.

Hi, I've try but failed.
the result is
PHP Warning: PHP Startup: ssh2: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP 5.3.27 (cli) (built: Aug 31 2013 05:18:26)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
.
can u help me?
 
Back
Top