Add php extension OpenSSL, MySQL via phpize

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:

1 2 3) 4 5 $ cd extname $ phpize $ ./configure $ make # make install

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

If the system does not have a phpize command and uses a precompiled package (for example, RPM), install the appropriate development version of the PHP package, which typically contains the phpize command and the corresponding header file for compiling PHP and its extension library.

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

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

Add a OpenSSL extension
1 2 3 4 5 6 7 8 9 # Cd/data/pkg/php-5.5.15/ext/openssl #/usr/local/webserver/php/bin/phpize cannot find CONFIG.M4. Make sure this you run '/usr/local/webserver/php/bin/phpize ' in the top level source directory of the module   # mv Config0.m4 config.m4   #./configure--with-openssl--with-php-config=/usr/local/ Webserver/php/bin/php-config # make && make install

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

1 2 3 4 5 6 7 8 # 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

Once the reboot is complete, the Create method in the previous RSA can be called to generate the public key, private key pair.

1 print_r(RsaUtil::create());
Add MySQL Extension
1 2 3 4 5 6 7 8 9 10 11 12 13 14 # 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   #./configure--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/   # vi/usr/local/webserver/php/lib/php.ini

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

1 2 3 4 5 6 # 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.

--eof--

Add php extension OpenSSL, MySQL via phpize

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.