lnmp开启fsockopen()函数

今天安装dedecms模块无法显示,网上查找了资料,有两种方法,查了下相关方法 贴出来分享 具体办法:

第一种方法是自己有服务器的如下修改 : 
编辑/usr/local/php/etc/php.ini 查找disable_functions
将里面的fsockopen 去掉执行: /etc/init.d/php-fpm restart

第二种方法直接修改程序,比较方便。

在用fsockopen()的地方用 stream_socket_client()代替就可以了。

具体修改地方是 /include/dedehttpdown.class.php 第507行

$this->m_fp = @fsockopen($this->m_host, $this->m_port, $errno, $errstr,10);
替换为
$this->m_fp = @stream_socket_client($this->m_host . ':' . $this->m_port, $errno, $errstr,10);
 

Last modification:July 14, 2020
如果觉得我的文章对你有用,请随意赞赏