Use phpize to add PHP extension openssl and mysql

Source: Internet
Author: User
The phpizephpize command is used to prepare the compiling environment of the PHP extension library. In the following example, the source program of the extension library is located in the extname Directory: $ cdextname $ phpize $. configure $ make # extname will be created for successful makeinstall installation. so is stored in the PHP extension library directory. You need to adjust php. ini to add exte

The phpize command is used to prepare the compiling environment of the PHP extension library. In the following example, the source program of the extension library is located in the extname Directory: $ cd extname $ phpize $. /configure $ make # extname will be created for successful installation of make install. so is stored in the PHP extension library directory. You need to adjust php. ini to add exte

Phpize

The phpize command is used to prepare the compiling environment of the PHP extension library. In the following example, the source program of the extension library is located in the extname directory:

$ cd extname$ phpize$ ./configure$ make# make install

After successful installation, extname. so is created and placed in the extension library directory of PHP. You must adjust php. ini and add extension = extname. so to use this extension library.

If the system does not have the phpize command and a pre-compiled package (such as RPM) is used, install the corresponding development version of the PHP package, this version usually contains the phpize command and the header files used to compile PHP and its extension libraries.

Use the phpize -- help Command to display the command usage.

Original article: 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/phpizeCannot find config.m4. Make sure that 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 compilation, add the generated openssl. so to php. ini and restart php-fpm.

# vi /usr/local/webserver/php/lib/php.ini# ps aux | grep phproot     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

After restart, you can call the create method in the previous rsa to generate a public key and private key pair.

print_r(RsaUtil::create());
Add mysql extension
# cd /data/pkg/php-5.5.15/ext/mysql# /usr/local/webserver/php/bin/phpize Configuring for:PHP Api Version:         20121113Zend Module Api No:      20121212Zend Extension Api No:   220121212# ./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-mysql=/usr/local/webserver/mysql/# make && make installBuild 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 to the directory indicated by, modify php. ini to add extension = mysql. so to restart php

# ps aux | grep phproot      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

Check whether PHPINFO has been added successfully.

Original article address: Add PHP extension openssl and mysql via phpize. Thank you for sharing it with me.

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.