Link to home
Start Free TrialLog in
Avatar of Theo
Theo

asked on

I need some help with installing Pear and Pecl

I have a VPS where I can login as root, and now I want to install both Pear and Pecl I need some guidance as I am not very familiar with the shell.

First Pear. In my Drupal setup I am offered a choice: Install PEAR File_IMC  or PEAR Contact_Vcard_Build package for vcard generation.

Does it matter?
Avatar of Beverley Portlock
Beverley Portlock
Flag of United Kingdom of Great Britain and Northern Ireland image

What is your Linux distro? For instance if you use Debian/Ubuntu then apt-get install php5-pear to install it. For Centos try yum install php5-pear
Sorry, I've misread the question - you already have PEAR installed?

Use File_IMC as it supercedes the other package

Avatar of Theo
Theo

ASKER

No I don't have pear installed. I'll download the file IMC and report back
After PEAR is installed try running

pear install File_IMC

to install the package
Avatar of Theo

ASKER

OK I have the tar.gz file on my pc now
Avatar of Theo

ASKER

When I say I want to install Pear does that mean two things? I do not understand what you mean by After PEAR is installed try running pear install file.

I have 'pear install File_IMC-0.4.1' on my pc. Now start up Putty and login?
OK I'm assuming that you did an apt-get install php5-pear or yum install .... or some such equivalent. This installs PEAR. Once this is done you should only have to type

pear install File_IMC

on a command and PEAR will install the correct package from the repository. I assumed that you were familiar with the Linux installation process which is very different from the Windows one in that you always try and avoid downloading and running an install. It's always better to install directly from the Linux repository.
Avatar of Theo

ASKER

So what should I do now?  Start up Putty?
If you mean SSH to the server and run pear install File_IMC on the command line then - yes. If you have PEAR in place.
Avatar of Theo

ASKER

Pear in place? I can get into ssh and log in, but then?

The tar.gz file is still on my pc
The tar.gz file doesn't matter. PEAR knows where to get what it needs. Just run the command above from SSH

Avatar of Theo

ASKER

That is easy and gives:


Failed to download pear/File_IMC within preferred state "stable", latest release is version 0.4.1, stability "beta", use "channel://pear.php.net/File_IMC-0.4.1" to install
install failed
Avatar of Theo

ASKER

Which is a perfectly  normal and to be expected reaction, since I did not upload the file I downloaded.
Not the world's clearest error message. It means change the command to this

pear install File_IMC-0.4.1
Avatar of Theo

ASKER

Hey!

install ok: channel://pear.php.net/File_IMC-0.4.1
Avatar of Theo

ASKER

Well according to Drupal it's all functioning now. I didnt expect it, because you shrouded your actions in fog, but you were right all the same. Wonderful, thanks

How about pecl?
PECL uses the same installer. PECL is really just PEAR under another name.

http://en.wikipedia.org/wiki/PHP_Extension_Community_Library#PECL

Just type

pear install <PECL PACKAGE NAME>

....because you shrouded your actions in fog....

Sorry about that. I've been busy all night and I have had to pop in and out. Normally I would give longer explanations, but it has been that sort of night.
Actually you need to type

pecl install <package>

it's the same installer underneath but it knows to use PECL rather than PEAR. Sorry about that.... not my night tonight....

:-(
Avatar of Theo

ASKER

Never mind, there was progress.
What do I put instead of package is it        'uploadprogress-1.0.1.tgz'  ?

Not that I know its there I just suspect it becauyse the pear package was there as well.

Avatar of Theo

ASKER

When I do as I suggest above, this is what I get:

install ok: channel://pear.php.net/File_IMC-0.4.1
[root@vps ~]# pecl install uploadprogress-1.0.1.tgz
downloading uploadprogress-1.0.1.tgz ...
Starting to download uploadprogress-1.0.1.tgz (8,536 bytes)
.....done: 8,536 bytes
4 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

ERROR: `phpize' failed
Same routine again

pecl install uploadprogress

and PECL will find what it needs in its repository
Avatar of Theo

ASKER

Yes, so I did, but now there is the error 'phpize' failed  and in Drupal I am not cleared yet, it doesnt see itself as functional.
Sorry - we cross posted. You're missing a PHP package that's needed. Install php5-dev with your installer. For me on Debian it would be

apt-get install php5-dev

or for Centos yum install php5-dev

This package has a LOT of dependencies and you must use the repository. After it installs do the

pecl install unloadprogress

and hopefully everything will be OK. That's me for tonight, I'll catch this up tomorrow if it is still open.

Good luck
Avatar of Theo

ASKER

Thanks, but I also cal it quits for tonight.
Avatar of Theo

ASKER

Plerase explain:
This package has a LOT of dependencies and you must use the repository

Repository means that the package is already on my server as was pear?
Note: In the following discussion I concentrate on the Debian installer because that is what I use on our servers. If you use CentOs / RedHat then replace apt-get by yum

I'm sure you are familiar with installing software on Windows - find a package, download it, run its installer. When I first moved to Linux I continued this approach to software installation and I broke much of the software on the system by doing this. I was installing software that overwrite library code (DLLs in Windows, SOs in Linux) with versions that were incompatiable with the installed versions.

What I had not realised back then is that every Linux distribution comes with a repository.

The repository is a library full of software - either preinstalled on your machine or available online - in which each piece of software has a description of other software that it depends on and what versions those dependencies are.

To install software on Linux, find its repostiory name, for example php5-dev and use your installer to install it. On Debian distros I would type apt-get install php5-dev and the installer goes to the repository (it knows where to find it) and it looks up your package. It then determines all the other packages or libraries that must be installed if yours is going to work and it selects then and installs them first then it does your package. In the case of php5-dev it may install C compilers. packages from Zend, code needed for PECL and so on.

Let us say I wanted to install PHP5, MySQL, Apache and phpMyAdmin on WINDOWS. If I did not use XAMPP or WAMP then I would have to download each package and run its installer one at a time. If I wanted to install these on Linux I would type apt-get install phpmyadmin and because that package requires PHP and MySQL the installer will install those as well, but the installer also notices that PHP requires Apache so it will install Apache too.

Occassionally you come across a package you want that is NOT in the repository. The safest way to install this is to feed that package to the installer via the command line and let it resolve all the dependencies and tell you if the package is safe to install. Just unzipping the code and copying it into place is a recipe for disaster - I know because I created enough of them until I learned to use the repositories.
Avatar of Theo

ASKER

Thank you very much for this clarification!  Great!
I'll get at it right away.
Avatar of Theo

ASKER

[root@vps ~]# yum install php5-dev
Loaded plugins: fastestmirror
Determining fastest mirrors
 * addons: centos.mirror.nac.net
 * base: centos.omnispring.com
 * extras: centos.mirror.nac.net
 * updates: centos.aol.com
addons                                                   |  951 B     00:00
base                                                     | 2.1 kB     00:00
extras                                                   | 2.1 kB     00:00
extras/primary_db                                        | 181 kB     00:00
updates                                                  | 1.9 kB     00:00
updates/primary_db                                       | 915 kB     00:00
Excluding Packages in global exclude list
Finished
Setting up Install Process
No package php5-dev available.
Nothing to do
It must have a different name in the CentOS repository.  Try

yum install php-devel

Avatar of Theo

ASKER

Same result, nothing to do
Avatar of Theo

ASKER

Fyi, I am on PHP       5.2.16
Try seeing if php-devel is listed. Try this

yum list php-devel

if that does not work then try

yum list php5

Does it show up anywhere?
Avatar of Theo

ASKER

php-devel: No matching packages
php5: no matching packages
"php5: no matching packages"

?????

yum list php   (leave the 5 off?)

If that doesn't work I think you'll need to post something on a CentOS forum. I could talk you through the Debian stuff but I'm not familiar enough with CentOS
Avatar of Theo

ASKER

That doesnt work either. On the Centos forum, I see this advise: How about posting /etc/yum.repos.d/CentOS-Base.repo
It is there, but how can I look into it?
Avatar of Theo

ASKER

Here it is, any ideas?
 vi CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
"CentOS-Base.repo" 60L, 2245C
Avatar of Theo

ASKER

Shouldnt I  remove the # from the base url in VI?
ASKER CERTIFIED SOLUTION
Avatar of Beverley Portlock
Beverley Portlock
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Theo

ASKER

Thanks very much, i learned a lot.
Sorry we did not manage to completely resolve it, but thanks for the kind words.