Installing PHP extension is very easy, if you install using PECL, PHP Extension Community Library, a repository of PHP extensions that are made available to you via PEAR packaging system. To enable PECL
I'm going to show you how to install the following PHP extensions.
1. phpredis
# pecl install redis
To load the extension on PHP startup, add "extension=redis.so" to /etc/php.ini
Restart web services (service httpd restart)
To verify this
# php -m | grep redis
2. MongoDB
# pecl install mongo
To load the extension on PHP startup, add a line: "extension=mongo.so" to /etc/php.ini
Restart web services (service httpd restart)
3. AMQP/RabbitMQ
Amqp requires these two packages installed: librabbitmq (RabbitMQ client itself) and librabbitmq-dev (dev headers etc.)
# yum install librabbit*
# pecl install amqp
Once the installation has completed we should add "extension=amqp.so" to /etc/php.ini
Restart web services (service httpd restart)
Issues: What if the desired extension is not available with PECL?
You need to install manually. The phpize command (you need to install php-devel to get this) is used to prepare the build environment for a PHP extension.
Download the tarball from the website using wget/curl, unpack using tar, read README/INSTALL, configure, build and install.
# wget/curl <link address>
# tar xvzf phpextnname.tar.gz or tar xvjf phpextnname.tar.bz2
# cd phpextnname
# phpizeDownload the tarball from the website using wget/curl, unpack using tar, read README/INSTALL, configure, build and install.
# wget/curl <link address>
# tar xvzf phpextnname.tar.gz or tar xvjf phpextnname.tar.bz2
# cd phpextnname
# ./configure
# make
# make install
A successful install will have created extname.so and put it into the PHP extensions directory. You'll need to and adjust php.ini and add an extension=extname.so line before you can use the extension.
Restart web services (service httpd restart)You can verify this by
# php -m | grep <php_extension_name>
Note: Don't delete your Makefile, if you want to uninstall your program at a later stage.
# make uninstall
• Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updatingAzure Online course
ReplyDeleteI LIKE THIS CONTENT VERY MUCH ITS VERY NICE
ReplyDeleteAzure Training in Chennai | Certification | Azure Online Training Course | Azure Training in Bangalore | Certification | Azure Online Training Course | Azure Training in Hyderabad | Certification | Azure Online Training Course | Azure Training in Pune | Certification | Azure Online Training Course | Azure Training | microsoft azure certification | Azure Online Training Course