Linux add php extensions via phpize OpenSSL, MySQL

Source: Internet
Author: User
Tags fpm openssl zend

Phpize

The Phpize command is used to prepare the compilation environment for the PHP Extension library. In the following example, the source program for the extension library is in the Extname directory:

$ cd extname

$ phpize $/configure $ make

# Install

A successful installation will create the extname.so and place it in the PHP Extension Library directory. You need to adjust php.ini to join the extension=extname.so to use this extension library.

If there is no phpize command in the system and a precompiled package (such as RPM) is used, install the corresponding development version of the PHP package, which typically contains the phpize command and the corresponding header file for compiling PHP and its extension libraries.

Use the Phpize--help command to display this command usage.

Original: http://php.net/manual/zh/install.pecl.phpize.php

Add OpenSSL extension

# Cd/data/pkg/php-5.5.15/ext/openssl

#/usr/local/webserver/php/bin/phpize

cannot find CONFIG.M4.

Make sure so you run '/usr/local/webserver/php/bin/phpize ', the top level source directory of the module

# m V config0.m4 config.m4

#./configure--with-openssl--with-php-config=/usr/local/webserver/php/bin/ Php-config

# make && make install

After the compilation completes, add the generated openssl.so to the php.ini and restart the PHP-FPM

# vi /usr/local/webserver/php/lib/php.ini   # ps aux | grep php Root      19714  0.0  0.5  21912  2652 ?         SS   09:20   0:00 PHP-FPM:  master process  (/usr/local/webserver/php/etc/php-fpm.conf) nobody   19715   0.0  0.8  21912  4144 ?         S    09:20   0:00 php-fpm: pool www                      Nobody    19716  0.0  0.8  22232  4308 ?         S    09:20   0:00 php-fpm:  pool www                     root     22464  0.0  0.1   4028    676 pts/0    r+   09:37   0:00 grep php #  kill -usr2 19714

When the reboot is complete, the Create method in the previous RSA can be invoked to generate the public and private key pair.

Print_r (Rsautil::create ());

Add MySQL Extensions

# cd/data/pkg/php-5.5.15/ext/mysql

#/usr/local/webserver/php/bin/phpize

configuring for:

php Api version:20121113

Zend Module API no:20121212

Zend Extension API no:220121212

#./confi Gure--with-php-config=/usr/local/webserver/php/bin/php-config--with-mysql=/usr/local/webserver/mysql/

# Make && make install build

complete.

Don ' t forget to run ' make test '.

Installing shared extensions:/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20121212/

c13/># Vi/usr/local/webserver/php/lib/php.ini

Mysql.so will automatically add Extension_dir to the directory, modify php.ini add extension=mysql.so restart PHP

# ps aux | grep php root      1422  0.0   0.4  22020  2404 ?        Ss    11:28   0:00 php-fpm: master process  (/usr/local/webserver/php/ etc/php-fpm.conf) nobody    1423  0.0  0.4  22020   2144 ?        s    11:28    0:00 php-fpm: pool www                      nobody    1424  0.0   0.4  22020  2144 ?        s     11:28   0:00 php-fpm: pool www                      root      4767   0.0  0.1   4028

680 pts/0 r+ 11:39 0:00 grep php
# KILL-USR2 1422

See if Phpinfo has been added successfully.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.