(dv):Install PECL extensions
- This page was last modified on February 20, 2012, at 17:40.
From (mt) Community Wiki
This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.
Contents |
Overview
PECL is a repository for PHP Extensions, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions.
Instructions
- Install the Developer Tools for your (dv) Dedicated-Virtual Server.
- Log into your server with a root or sudo user via SSH.
- Run the following command to change the temp directory for PECL and avoid permissions errors about executing files in the /tmp directory:
mkdir -p ~/tmp/pear/{cache,temp} && pear config-set download_dir ~/tmp/pear/cache && pear config-set temp_dir ~/tmp/pear/temp - Perform a channel-update for PEAR and PECL:
pear channel-update pear.php.net
pecl channel-update pecl.php.net
- Install uploadprogress (or your desired extension).
pecl install uploadprogress
- The module will be installed in /usr/lib/php/modules/ as /usr/lib/php/modules/uploadprogress.so.
- Add the following line your php.ini:
extension=uploadprogress.so
- Reboot Apache.
/etc/init.d/httpd restart
Compile from source
-
If the above method does not work for you, you'll need to compile the PECL extension from source, which is very easy.
- Browse to the directory you'd like the "temp" files to be stored at, in this case /root:
cd /root
- Next we'll download and extract the actual PECL extension tar.gz file (be sure to replace the PECL extension with the one you want here PECL):
wget http://pecl.php.net/get/uploadprogress-1.0.3.1.tgz && tar zxvf uploadprogress-1.0.3.1.tgz
- Next cd into the new directory and prepare for compiling:
phpize && ./configure -with-php-config=/usr/bin/php-config
- Once finished we'll compile and install it:
make && make install
- The module will be installed in /usr/lib/php/modules/ as /usr/lib/php/modules/uploadprogress.so.
- Add the following line your /etc/php.ini (Or if you're using FastCGI on Plesk 10, use /var/www/vhosts/yourdomain/etc/php.ini):
extension=uploadprogress.so
- Reboot Apache.
service httpd restart