Solved

I need some help with installing Pear and Pecl

Posted on 2011-03-01
40
740 Views
Last Modified: 2012-05-11
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
Comment
Question by:TheoRichel
  • 23
  • 17
40 Comments
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35009852
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
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35009869
Sorry, I've misread the question - you already have PEAR installed?

Use File_IMC as it supercedes the other package

0
 

Author Comment

by:TheoRichel
ID: 35009887
No I don't have pear installed. I'll download the file IMC and report back
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35009928
After PEAR is installed try running

pear install File_IMC

to install the package
0
 

Author Comment

by:TheoRichel
ID: 35009933
OK I have the tar.gz file on my pc now
0
 

Author Comment

by:TheoRichel
ID: 35010025
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
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35010772
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
 

Author Comment

by:TheoRichel
ID: 35011072
So what should I do now?  Start up Putty?
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35011142
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
 

Author Comment

by:TheoRichel
ID: 35011170
Pear in place? I can get into ssh and log in, but then?

The tar.gz file is still on my pc
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35011541
The tar.gz file doesn't matter. PEAR knows where to get what it needs. Just run the command above from SSH

0
 

Author Comment

by:TheoRichel
ID: 35011623
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
 

Author Comment

by:TheoRichel
ID: 35012264
Which is a perfectly  normal and to be expected reaction, since I did not upload the file I downloaded.
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35012398
Not the world's clearest error message. It means change the command to this

pear install File_IMC-0.4.1
0
 

Author Comment

by:TheoRichel
ID: 35012468
Hey!

install ok: channel://pear.php.net/File_IMC-0.4.1
0
 

Author Comment

by:TheoRichel
ID: 35012501
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
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35012571
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
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35012601
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
 

Author Comment

by:TheoRichel
ID: 35012672
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
 

Author Comment

by:TheoRichel
ID: 35012712
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35012725
Same routine again

pecl install uploadprogress

and PECL will find what it needs in its repository
0
 

Author Comment

by:TheoRichel
ID: 35012738
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
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35012785
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
 

Author Comment

by:TheoRichel
ID: 35012797
Thanks, but I also cal it quits for tonight.
0
 

Author Comment

by:TheoRichel
ID: 35014473
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
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35015118
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
 

Author Comment

by:TheoRichel
ID: 35016121
Thank you very much for this clarification!  Great!
I'll get at it right away.
0
 

Author Comment

by:TheoRichel
ID: 35016406
[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
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35016461
It must have a different name in the CentOS repository.  Try

yum install php-devel

0
 

Author Comment

by:TheoRichel
ID: 35016475
Same result, nothing to do
0
 

Author Comment

by:TheoRichel
ID: 35016538
Fyi, I am on PHP       5.2.16
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35016650
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
 

Author Comment

by:TheoRichel
ID: 35016678
php-devel: No matching packages
php5: no matching packages
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35016734
"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
 

Author Comment

by:TheoRichel
ID: 35016835
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
 

Author Comment

by:TheoRichel
ID: 35016873
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
 

Author Comment

by:TheoRichel
ID: 35016895
Shouldnt I  remove the # from the base url in VI?
0
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 500 total points
ID: 35016937
"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
 

Author Closing Comment

by:TheoRichel
ID: 35016989
Thanks very much, i learned a lot.
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35017016
Sorry we did not manage to completely resolve it, but thanks for the kind words.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PHP loop not working 4 33
Paging Using PHP 7 34
Web Reply Form - PHP with Upload 4 21
gdb doesn't stop on breakpoint 2 12
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now