CentOS configuration PHP supports socket extensions ____php

Source: Internet
Author: User
Tags configuration php install php phpinfo zts centos

PHP has many extensions, and we didn't have some extensions installed at the time of the initial installation, and we might need to use these extensions in the process. PHP provides a phpize tool for us to install the required extensions.

The following is an installation of the socket extension to introduce the use of phpize


1. Find your own PHP installation directory, such as my directory is/usr/local/php, in the directory, find Bin/phpize. If you do not have this tool, you do not have the tool installed, so you will need to install Php.dev, which is generally available.


2. To expand, you need to have a PHP version of the same as the currently installed PHP source package, the current version of PHP can be used phpinfo () view. It is the phpinfo.php that looks at the success of the installation after the initial installation. If not, go here to download the corresponding source code package: http://www.php.net/releases/


3. Open the source package directory, into the EXT directory, for example, I entered:/usr/local/php-5.2.17/ext, ext under the various PHP with the expansion module, into the ext/sockets.

# cd/usr/local/php-5.2.17/ext/sockets/


4. Execute the Phpize tool, after execution, you can see the corresponding configure file generated in the directory

#/usr/local/php/bin/phpize


5. You can now configure by configure to execute the following command:

./configure--prefix=/usr/local/php--with-php-config=/usr/local/php/bin/php-config--enable-sockets

Make && make install

After execution, you can see the following output:

Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613

The first is the build directory of the extension module, where you can see the corresponding sockets.so file


6. Change the php.ini and add the following statement:

extension= "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/sockets.so"


7. Restart Apache to see if the phpinfo.php page is properly loaded sockets expansion

# Service httpd Restart


http://ipeng.blog.163.com/blog/static/27836929201303022612539/

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.