Home > Backend Development > PHP Tutorial > Detailed explanation of php sockets extension installation and configuration_PHP tutorial

Detailed explanation of php sockets extension installation and configuration_PHP tutorial

WBOY
Release: 2016-07-13 17:08:45
Original
3017 people have browsed it

This article will give you a detailed introduction to the installation and configuration of the php sockets extension. I hope this method will be helpful to you.

Today I installed cacti and found that the php sockets extension is required, but the current lnmp is not installed, so I thought of the phpzie tool to install the extension. The installation method is as follows:

Open sockets extension in linux

The code is as follows
 代码如下 复制代码

1.cd php-5.3.8/ext/sockets/
2./usr/local/php/bin/phpize
3../configure --enable-sockets --with-php-config=/usr/local/php/bin/php-config
4.make
5.make install

Copy code

 代码如下 复制代码

1.extension=sockets.so
service php-fpm reload或service httpd reload

1.cd php-5.3.8/ext/sockets/

2./usr/local/php/bin/phpize 3../configure --enable-sockets --with-php-config=/usr/local/php/bin/php-config 4.make

5.make install



Then add the loading extension code in /etc/php.ini:

The code is as follows
 代码如下 复制代码
if(!extension_loaded(‘sockets’))
{
if(strtoupper(substr(PHP_OS, 3)) == “WIN”)
{
dl(‘php_sockets.dll’);
}
else
{
dl(‘sockets.so’);
}
}
?>
Copy code
1.extension=sockets.so service php-fpm reload or service httpd reload

Open the sockets extension in windows If you have not opened it, please edit your php.ini file and remove the comment in front of the following line: extension=php_sockets.dll If you cannot remove the comment, then please use the following code to load the extension library:
The code is as follows Copy code
if(!extension_loaded(‘sockets’)) {<🎜> if(strtoupper(substr(PHP_OS, 3)) == “WIN”)<🎜> {<🎜> dl(‘php_sockets.dll’);<🎜> }<🎜> else<🎜> {<🎜> dl(‘sockets.so’);<🎜> }<🎜> }<🎜> ?> http://www.bkjia.com/PHPjc/629816.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629816.htmlTechArticleThis article will give you a detailed introduction to the php sockets extension installation and configuration. I hope this method will be helpful to you. . Today I installed cacti and found that php sockets extension is required, and now...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template