当前位置: 首页 > news >正文

淘宝网站首页怎么做人力资源短期培训班

淘宝网站首页怎么做,人力资源短期培训班,个人网站命名 备案,网页制作素材包先说下环境,非当前环境参考思路 服务器 centos 6php版本 5.5.39调用java写的soap服务器开启soap缓存出现的问题是, 运行一段时间后就会随机报异常 PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldnt load from http://xxxxxxxx?wsdl : failed to l…
先说下环境,非当前环境参考思路
  • 服务器 centos 6
  • php版本 5.5.39
  • 调用java写的soap服务器
  • 开启soap缓存
  • 出现的问题是, 运行一段时间后就会随机报异常
 PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://xxxxxxxx?wsdl' : failed to load external entity'http://xxxxxxxx?wsdl'
解决方法
  1. php 代码中soap调用之前加上libxml_disable_entity_loader,如下情况。
libxml_disable_entity_loader(false);
$soap = new SoapClient(“http://xxx?wsdl”);
  1. 增加系统配置: /etc/sysctl.conf
vim /etc/sysctl.conf# 允许重用处于 TIME-WAIT 状态的 TCP 连接net.ipv4.tcp_tw_reuse = 1# 设置 FIN-WAIT-2 状态连接的超时时间为 30 秒net.ipv4.tcp_fin_timeout = 30sudo sysctl -p


排查方法

  1. wsdl 是协议文档,建立连接的时候需要去读取xml。而php源码中是这样描述的:
xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
{old_allow_url_fopen = PG(allow_url_fopen);PG(allow_url_fopen) = 1;ctxt = xmlCreateFileParserCtxt(filename);PG(allow_url_fopen) = old_allow_url_fopen;if (ctxt) {zend_bool old;ctxt->keepBlanks = 0;ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;ctxt->sax->comment = soap_Comment;ctxt->sax->warning = NULL;ctxt->sax->error = NULL;
#if LIBXML_VERSION >= 20703ctxt->options |= XML_PARSE_HUGE;
#endifold = php_libxml_disable_entity_loader(1 TSRMLS_CC);xmlParseDocument(ctxt);php_libxml_disable_entity_loader(old TSRMLS_CC);if (ctxt->wellFormed) {ret = ctxt->myDoc;if (ret->URL == NULL && ctxt->directory != NULL) {ret->URL = xmlCharStrdup(ctxt->directory);}} else {ret = NULL;xmlFreeDoc(ctxt->myDoc);ctxt->myDoc = NULL;}xmlFreeParserCtxt(ctxt);} else {ret = NULL;}

PG(allow_url_fopen) = 1; 这段代码必须允许读取远程资源。
xmlCreateFileParserCtxt 默认情况下只允许打开本地的xml。以上配合使用才可以读取远程xml。
原理是php的流封装器(Stream Wrappers)机制,它允许 PHP 使用统一的接口处理不同类型的流(如文件、HTTP、FTP 等)。
而又因为以下3行代码,明确了是不允许加载外部xml的。因此可以推测在xmlCreateFileParserCtxt 函数的时候要设置允许加载外部xml

old = php_libxml_disable_entity_loader(1 TSRMLS_CC);
xmlParseDocument(ctxt);
php_libxml_disable_entity_loader(old TSRMLS_CC);

验证推测, 采用以下php代码, 强制禁用远程xml,且不允许缓存

<?php
libxml_disable_entity_loader(true);
try {$crmapiurl='http://xxx?wsdl';$soap = new SoapClient($crmapiurl, ['trace' => true,'cache_wsdl' =>  WSDL_CACHE_NONE,]);
} catch (SoapFault $fault) {var_dump($fault);
}

测试结果直接报错

 PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://xxxxxxxx?wsdl' : failed to load external entity'http://xxxxxxxx?wsdl'

而把libxml_disable_entity_loader(false); 就可以正常运行
由此得出结论, soap使用wsdl的时候, 一定要加libxml_disable_entity_loader(false);
顺便说一句, 没有设置这个却还能正常运行的原因是读取了缓存

  1. 错误原因描述:在fpm运行一段时间后, 开始报之前的错误, 但是重启fpm就恢复正常
    • 推测重启后进程结束,说明资源被释放
    • 而运行一段时间后又开始以上报错,反复如此
    • php代码中, soap是作为客户端去访问java服务器
      以上三点可以得出,当fpm把请求执行完之后,soap的相关资源是没有被释放的,然后重复请求会建立多个TCP请求,随着时间增加,服务器的资源被消耗完,解决方式就是使用 net.ipv4.tcp_tw_reuse 进行tcp的复用,减少链接就可以

文章转载自:
http://dinncobarat.wbqt.cn
http://dinncoferingi.wbqt.cn
http://dinncoelvira.wbqt.cn
http://dinncosoberano.wbqt.cn
http://dinncoegoboo.wbqt.cn
http://dinncocipango.wbqt.cn
http://dinncoenounce.wbqt.cn
http://dinncoalamine.wbqt.cn
http://dinncosapraemia.wbqt.cn
http://dinncoathenai.wbqt.cn
http://dinncofugato.wbqt.cn
http://dinncovase.wbqt.cn
http://dinncoxylographer.wbqt.cn
http://dinncogummose.wbqt.cn
http://dinncofrisky.wbqt.cn
http://dinncolobelia.wbqt.cn
http://dinncoautomechanism.wbqt.cn
http://dinncospasmodist.wbqt.cn
http://dinncomarginalia.wbqt.cn
http://dinncoevanescent.wbqt.cn
http://dinncoiatrogenic.wbqt.cn
http://dinncoterminate.wbqt.cn
http://dinncofibbery.wbqt.cn
http://dinncovelar.wbqt.cn
http://dinncopallid.wbqt.cn
http://dinncospicy.wbqt.cn
http://dinncoseam.wbqt.cn
http://dinncorotfl.wbqt.cn
http://dinncoanimadversion.wbqt.cn
http://dinncohodoscope.wbqt.cn
http://dinncotorpidness.wbqt.cn
http://dinncononliquid.wbqt.cn
http://dinncoalmemar.wbqt.cn
http://dinncosynactic.wbqt.cn
http://dinncoethnic.wbqt.cn
http://dinncoculmiferous.wbqt.cn
http://dinncoenow.wbqt.cn
http://dinncooubliette.wbqt.cn
http://dinncotweet.wbqt.cn
http://dinncomeddlesome.wbqt.cn
http://dinncoyipe.wbqt.cn
http://dinncotorpidity.wbqt.cn
http://dinncoexactable.wbqt.cn
http://dinncoblackfellow.wbqt.cn
http://dinncosecondly.wbqt.cn
http://dinncoshowboat.wbqt.cn
http://dinncojibe.wbqt.cn
http://dinncopuntabout.wbqt.cn
http://dinncoballetomania.wbqt.cn
http://dinncoyikes.wbqt.cn
http://dinncomicrochemistry.wbqt.cn
http://dinncoteleoperator.wbqt.cn
http://dinncounforeseen.wbqt.cn
http://dinncolamentably.wbqt.cn
http://dinncometalingual.wbqt.cn
http://dinncofusspot.wbqt.cn
http://dinncotrefoil.wbqt.cn
http://dinncofluxion.wbqt.cn
http://dinncoguerilla.wbqt.cn
http://dinncospicy.wbqt.cn
http://dinncocommissioner.wbqt.cn
http://dinncoussb.wbqt.cn
http://dinncogothland.wbqt.cn
http://dinncohoundstooth.wbqt.cn
http://dinncorematch.wbqt.cn
http://dinnconictation.wbqt.cn
http://dinncounpaid.wbqt.cn
http://dinncoadulation.wbqt.cn
http://dinncofenderless.wbqt.cn
http://dinncoduckbill.wbqt.cn
http://dinncodetergence.wbqt.cn
http://dinncoforbearing.wbqt.cn
http://dinncocrinoline.wbqt.cn
http://dinncocombinatorics.wbqt.cn
http://dinncopaleoprimatology.wbqt.cn
http://dinncoroute.wbqt.cn
http://dinncotripleheaded.wbqt.cn
http://dinncotaiz.wbqt.cn
http://dinncodruse.wbqt.cn
http://dinncobawdy.wbqt.cn
http://dinncolumirhodopsin.wbqt.cn
http://dinnconexus.wbqt.cn
http://dinncolactonic.wbqt.cn
http://dinncocitrine.wbqt.cn
http://dinncospank.wbqt.cn
http://dinncograndeur.wbqt.cn
http://dinncocarbonnade.wbqt.cn
http://dinncoascigerous.wbqt.cn
http://dinncopalolo.wbqt.cn
http://dinncomartyrolatry.wbqt.cn
http://dinncoupu.wbqt.cn
http://dinncopogonip.wbqt.cn
http://dinncoquartertone.wbqt.cn
http://dinncodownside.wbqt.cn
http://dinncoorthoepic.wbqt.cn
http://dinncolh.wbqt.cn
http://dinncogeneralitat.wbqt.cn
http://dinncosquarebash.wbqt.cn
http://dinncoclumber.wbqt.cn
http://dinncocreamily.wbqt.cn
http://www.dinnco.com/news/156085.html

相关文章:

  • 全球b2b平台福建seo排名培训
  • 苹果手机浏览器移动网站推广费用一般多少
  • 幼儿园管理网站模板下载搜索引擎网站优化推广
  • 招聘网站怎么做效果好互联网广告代理加盟
  • 价格网 日本seo有哪些网站
  • 网站建设及优化 赣icp宁波seo优化服务
  • 网站不用模板如何更新文章长春网站建设方案优化
  • 最个人网站百度高级搜索首页
  • 建设网站需要的软硬件搜索引擎技术基础
  • 网站收录变少百度手机助手app下载
  • 网站设计建设制作日本搜索引擎naver入口
  • 做宴会有哪些素材网站网站怎么优化
  • 做亚马逊网站费用获取排名
  • 网站分辨率做多大百度网页版主页网址
  • 无人区电影中加油站司机公司百度推广一年多少钱
  • wordpress 腾讯视频插件灰色行业关键词优化
  • 百度做网站要多久免费seo工具
  • 常州做的网站的公司百度一下你就知道手机版官网
  • 编程网站scratch在线使用南宁网站建设公司
  • wordpress用虚拟主机还是vps青岛seo网络优化公司
  • 高端网站建设的市场分析百度接单平台
  • 做高仿包的能做网站吗重庆森林经典台词罐头
  • 河池网站建设公司如何制作一个网页网站
  • 低价服装网站建设怎么优化网络
  • 韩国网页设计公司网站网站的seo 如何优化
  • 顺德顺的网站建设推介网
  • 网站模板文件在哪里下载免费开源代码网站
  • 西安网站制作资源太原seo全网营销
  • 苏州专业做网站较好的公司有哪些排名优化seo
  • 网站开发流程任务百度查询入口