lnmp开启fsockopen()函数
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);
当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »
因本文不是用Markdown格式的编辑器书写的,转换的页面可能不符合AMP标准。