This article will give you a detailed description of the php sockets extension installation configuration. I hope this method will be helpful to you.
After installing cacti today, I found that php sockets extensions are required, but lnmp is not installed now, so I thought of phpzie tool to install extensions. The installation method is as follows:
Enable sockets extension in linux
| The Code is as follows: |
Copy code |
|
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: |
Copy code |
|
1. extension = sockets. so
Service php-fpm reload or service httpd reload |
Enable sockets extension in windows
If you do not open the file, edit your php. ini file and remove the comments in the following line:
Extension = php_sockets.dll
If you cannot remove the annotation, use the following code to load the extension Library:
| The Code is as follows: |
Copy code |
<? Php
If (! Extension_loaded ('buckets '))
{
If (strtoupper (substr (PHP_ OS, 3) = "WIN ")
{
Dl ('php _ sockets. dll ');
}
Else
{
Dl ('ets ETS. so ');
}
}
?>
|