Support
- Advanced Backup
- Client Side
- Cloud Enterprise
- ColdFusion
- Control Panel
- cPanel
- Customer Portal
- DNS Information
- Dedicated Servers
- DirectAdmin
- Domain Name
- dotDefender
- Dreamweaver
- FileCatalyst
- Front Page
- FTP
- General Information
- Hosted Exchange & SharePoint
- IIS6
- IIS7
- Juniper Netscreen Firewalls
- Linux
- Bind Multiple IP Addresses to a Single Network Interface Card (NIC)
- Clear Memory Cache on Linux Server
- Set the time on a Linux server
- Check Disk Usage in Linux
- Add Custom SpamAssassin Rules
- Install OSSEC on a Linux server
- Define the Default Document Order for a Shared Linux Server
- Administer a Website Using Webmin
- Use a Redirect Script in PHP
- Upgrade PHP on a Linux Server
- Install phpMyAdmin on a Linux server
- Add a Redirect Script to Your .htaccess File
- Install the Mumble VoIP Server to Redhat or CentOS
- Add PHP Extensions with No Control Panel or Plesk
- How To Update Linux Packages Using Webmin
- Evaluate Disk Usage on Linux Plesk Server
- How to monitor Bandwidth with VNstat
- Bind IPs to a server in Linux
- Using the Htaccess File to Block IP Access
- Using The Htaccess File for PHP Directives
- Search for a file via SSH
- Install Tomcat on a Linux Server
- Install the Railo CFML Server in Linux
- Tuning the Apache Prefork MPM
- Adding FTP Users For VSFTP
- Installing htop
- Enable Apache mod_status
- Evaluate Disk Usage on Linux Cpanel Server
- Locate Newly Created Files in Linux
- Configure Keep Alives on SSH Server in Linux
- Adjusting the Amount of Swap
- How to Disable IPv6 For Redhat and Centos
- Enable and Use the Apache Info Module
- Install NCDU on a Linux Server
- Manage the Qmail queue with qmHandle
- Retaining File Permissions While Using SCP
- How To Compress And Uncompress Files
- Installing Freetds For Linux
- Create Search Engine Friendly URLs with mod_rewrite
- Adding Users To A Usergroup
- Installing Vim
- Use TCP Variable tcp_syncookies to prevent "syn flood attack"
- How To Limit Process CPU Usage
- Install and Configure the Cherokee Web Server on Linux
- Installing Python 3 on CentOS/Redhat 5.x From Source
- Configure Syntax Highlighting in Vim
- Install and Configure the Nginx Web Server on Linux
- Set Hostname
- Using Tmux
- MySQL Slow Query Logging
- Using the Linux Uptime Command
- Using sar to Monitor System Performance
- Compile Software On Linux
- Using the Linux Man Command
- Mounting NFS Shares
- Move and Copy Files within Linux
- Configure NFS Server Shares
- Software Management with RPM and Yum
- Update the Webmin Control Panel
- Viewing Live Bandwidth with iftop
- Using GNU Screen
- Sshwindows
- Sshmac
- Directorystructure
- Errorcheck
- vi Text Editor
- Find Heaviest Email Users of Postfix MTA's Deferred Spool
- Common Rewrite Rules for .htaccess
- Turn on directory listing in Linux
- Redirect non-www URLs to www URLs using a .htaccess file
- Force Visitor Browser to use SSL in Apache
- Apache Error Logging
- Password-less Login Through SSH Linux To Linux
- Log SSH Sessions with Putty
- SSH Server on Alternative Port
- SSH Server as Secure SOCKS Proxy
- Install the PHP Process Manager (php-fpm)
- Configure Apache to Use PHP-FPM
- Configure Nginx to Use PHP-FPM
- Cgiscripts
- Htaccess
- Linux Faq
- Phpmail
- Phpmailer
- Phpsqlinjection
- Phpversion
- Sendmail
- Add a Redirect Script to your Ruby on Rails Application
- Use a CGI PERL Redirect Script
- List Server
- MIVA Merchant
- MySQL
- Patching / Server Updates
- phpMyAdmin
- Plesk
- Policies and Procedures
- Premium Spam Filtering
- Programming
- Ruby on Rails
- Search Engine Submission
- SharePoint 3
- SharePoint 2010
- SiteDesigner
- SmarterMail 3
- SmarterMail 4
- SmarterMail 5
- SmarterMail 6
- SmarterMail 7
- SmarterStats
- SmarterTrack
- SQL Server
- Secure Socket Layer (SSL)
- Uploading Your Website
- Video Tutorials
- Windows Server 2003
- Windows Server 2008
- Web Design
- WordPress
- Advanced Monitoring
- MediaWiki
- Enkompass
- Microsoft Outlook 2010
- Android
- Outlook Web Access
- Critical Availability Service
- NAS Data Transfer
- Customer Portal Demos
- Joomla
- Moodle
- Cloud Dedicated
- Gallery CMS
- phpBB
- Standard Monitoring
- Righteous Restore
- NAS (Network Attached Storage)
- Networking
- SmarterMail 8
- PCI Security Scan
- LinkTiger
- Windows Cloud VPS
- Linux Cloud VPS
- Linux VPS
- Windows VPS
- Hyper V
- ENSIM
- Alert Logic
- Webmin
- e107
- Vbulletin
- VPN
- Visual Vault
- Mozilla Thunderbird
- PyroCMS
- Active Directory
- Vmware Related
- Drupal
Add PHP Extensions with No Control Panel or Plesk
This article will cover how to compile a shared object file for PHP without having to recompile Apache entirely. This article does not apply to WHM (Cpanel) as Cpanel has its own internal compiler.
PHP Version
First you need to obtain the version of PHP the server is running. Log into the server via SSH [Windows | Mac] and run the following command:
$ php –v
This will report data similar to the following:
PHP 5.1.6 (cli) (built: Sep 20 2007 10:16:10) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
In this case, the server is running PHP version 5.1.6. You need to grab the source for this exact version of PHP; you can find a complete archive on php.net's release site. Copy the download link as you will need it to download the archive to the server:
$ cd /usr/local/src
$
$ wget http://museum.php.net/php5/php-5.1.6.tar.gz
--13:13:06-- http://museum.php.net/php5/php-5.1.6.tar.gz
Resolving museum.php.net... 128.39.198.38
Connecting to museum.php.net|128.39.198.38|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8187896 (7.8M) [application/x-tar]
Saving to: `php-5.1.6.tar.gz'
100%[==========================================================================================>] 8,187,896 574K/s in 14s
13:13:21 (554 KB/s) - `php-5.1.6.tar.gz' saved [8187896/8187896]
Requirements
Make sure that the server has the development tools from our distribution:
$ yum groupinstall "Development Tools"
We'll also need to ensure the server has the PHP development package installed:
$ yum install php-devel
Some PHP extensions are built-in with no external requirements however most do require a library or two. As an example, the steps below will show how to install the mcrypt extension. To get information on a particular extensions just go to http://php.net/<extensionName> (http://php.net/mcrypt, in our example). In this documentation is a section called Installing/Configuring. Be sure to read this page as it contains all the information you will need to compile the extension.
These functions work using » mcrypt. To use it, download libmcrypt-x.x.tar.gz from » http://mcrypt.sourceforge.net/ and follow the included installation instructions. Windows users will find all the needed compiled mcrypt binaries at » http://files.edin.dk/php/win32/mcrypt/.
As of PHP 5.0.0 you will need libmcrypt Version 2.5.6 or greater.
If you linked against libmcrypt 2.4.x or higher, the following additional block algorithms are supported: CAST, LOKI97, RIJNDAEL, SAFERPLUS, SERPENT and the following stream ciphers: ENIGMA (crypt), PANAMA, RC4 and WAKE. With libmcrypt 2.4.x or higher another cipher mode is also available; nOFB.
So this extension requires the 'mcrypt' library. Luckily if your distribution supports 'mcrypt' we can typically run 'yum install libmcrypt' (CentOS) and then proceed to the next step. Many extensions require the development packages be installed for a particular piece of software, in such cases the development libraries are named `packageName-devel`. If your distribution does not support 'mycrypt', or the library required by your extension, follow the instructions found on the Installing/Configuring page.
Compilation
Now that the server meets the necessary requirements you will need to extract the archive and compile the module.
This method works for PECL extensions as well as built-in extensions:
$ tar xzf php-5.1.6.tar.gz && cd php-5.1.6
$ cd ext/mcrypt/
$ phpize
$ ./configure && make && make install
For extensions such as mcrypt the configuration file may not be created automatically. As such, you will need to create a file in /etc/php.d/extension.ini replacing extension with the name of the extension you are installing with the following information:
$ cat /etc/php.d/mcrypt.ini
extension=mcrypt.so
Cleanup
Note: Some important packages like Subversion could be removed by doing this! Use at your own discretion.
$ yum groupremove "Development Tools"
Testing
Check that PHP recognizes your new extension:
$ php -i | grep mcryptmcrypt
mcrypt support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
If the extension is recognized, restart Apache and the extension is ready for use.
