• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 811
  • Last Modified:

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?
0
TheoRichel
Asked:
TheoRichel
  • 23
  • 17
1 Solution
 
Beverley PortlockCommented:
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
0
 
Beverley PortlockCommented:
Sorry, I've misread the question - you already have PEAR installed?

Use File_IMC as it supercedes the other package

0
 
TheoRichelAuthor Commented:
No I don't have pear installed. I'll download the file IMC and report back
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Beverley PortlockCommented:
After PEAR is installed try running

pear install File_IMC

to install the package
0
 
TheoRichelAuthor Commented:
OK I have the tar.gz file on my pc now
0
 
TheoRichelAuthor Commented:
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?
0
 
Beverley PortlockCommented:
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.
0
 
TheoRichelAuthor Commented:
So what should I do now?  Start up Putty?
0
 
Beverley PortlockCommented:
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.
0
 
TheoRichelAuthor Commented:
Pear in place? I can get into ssh and log in, but then?

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

0
 
TheoRichelAuthor Commented:
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
0
 
TheoRichelAuthor Commented:
Which is a perfectly  normal and to be expected reaction, since I did not upload the file I downloaded.
0
 
Beverley PortlockCommented:
Not the world's clearest error message. It means change the command to this

pear install File_IMC-0.4.1
0
 
TheoRichelAuthor Commented:
Hey!

install ok: channel://pear.php.net/File_IMC-0.4.1
0
 
TheoRichelAuthor Commented:
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?
0
 
Beverley PortlockCommented:
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.
0
 
Beverley PortlockCommented:
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....

:-(
0
 
TheoRichelAuthor Commented:
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.

0
 
TheoRichelAuthor Commented:
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
0
 
Beverley PortlockCommented:
Same routine again

pecl install uploadprogress

and PECL will find what it needs in its repository
0
 
TheoRichelAuthor Commented:
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.
0
 
Beverley PortlockCommented:
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
0
 
TheoRichelAuthor Commented:
Thanks, but I also cal it quits for tonight.
0
 
TheoRichelAuthor Commented:
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?
0
 
Beverley PortlockCommented:
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.
0
 
TheoRichelAuthor Commented:
Thank you very much for this clarification!  Great!
I'll get at it right away.
0
 
TheoRichelAuthor Commented:
[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
0
 
Beverley PortlockCommented:
It must have a different name in the CentOS repository.  Try

yum install php-devel

0
 
TheoRichelAuthor Commented:
Same result, nothing to do
0
 
TheoRichelAuthor Commented:
Fyi, I am on PHP       5.2.16
0
 
Beverley PortlockCommented:
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?
0
 
TheoRichelAuthor Commented:
php-devel: No matching packages
php5: no matching packages
0
 
Beverley PortlockCommented:
"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
0
 
TheoRichelAuthor Commented:
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?
0
 
TheoRichelAuthor Commented:
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
0
 
TheoRichelAuthor Commented:
Shouldnt I  remove the # from the base url in VI?
0
 
Beverley PortlockCommented:
"How about posting /etc/yum.repos.d/CentOS-Base.repo It is there, but how can I look into it?"

I don't know. I spend all my time doing PHP, not Linux. You'll have to ask someone who knows CentOS well. To sum up the position we have reached seems to be as follows:

1. We have installed PEAR and the PEAR package
2. PECL is installed (it's really PEAR)
3. We need the program phpize to allow the PECL package to load
4. phpize is part of the PHP5-DEV / PHP-DEVEL package and we cannot find this
5. If you get phpize working then we will probably get the PECL package working

So it all hinges on this phpize program, but I have gone as far as my meagre CentOS knowledge will take me.

There is a Linux OS forum here on EE and I would suggest you post a question about phpize, php-devel and the repository problem. Emphasize that you have not done much Linux installation so that they don't make unwarranted assumptions about your knowledge level and give you advice that you will not understand.
0
 
TheoRichelAuthor Commented:
Thanks very much, i learned a lot.
0
 
Beverley PortlockCommented:
Sorry we did not manage to completely resolve it, but thanks for the kind words.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 23
  • 17
Tackle projects and never again get stuck behind a technical roadblock.
Join Now