Home > php教程 > php手册 > php sockets扩展安装配置详解

php sockets扩展安装配置详解

WBOY
Release: 2016-06-13 10:10:52
Original
1092 people have browsed it

本文章来给各位同学详细介绍关于php sockets扩展安装配置详解,希望此方法对各位同学有帮助。

今天安装cacti发现需要php sockets扩展,而现在的lnmp没有安装,于是想到了phpzie工具安装扩展,安装方法如下:

linux中打开sockets扩展

 代码如下 复制代码

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

接着在/etc/php.ini添加加载扩展代码:

 代码如下 复制代码

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

windows下打开sockets扩展

如果你没有打开,请编辑你的php.ini文件,去掉下面这行前面的注释:
extension=php_sockets.dll
如果你无法去掉注释,那么请使用下面的代码来加载扩展库:

 代码如下 复制代码
if(!extension_loaded(‘sockets’))
{
if(strtoupper(substr(PHP_OS, 3)) == “WIN”)
{
dl(‘php_sockets.dll’);
}
else
{
dl(‘sockets.so’);
}
}
?>
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template