草庐IT

create_connection

全部标签

php - Windows 7 上的 Netbeans Xdebug "waiting for connection"WAMP

针对这个常见的Xdebug错误,我阅读了很多解决方案,但似乎并没有解决我的问题:netbeansshows“WaitingForConnection(netbeans-xdebug)”NetbeansnotconnectingwithxdebugonWamp:“showingwaitingforconnection”在phpinfo()中Xdebug似乎配置正确:下面是我的php.ini:zend_extension="c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll";[xdebug]xde

php - <b> fatal error </b> : Uncaught exception 'Exception' with message 'Failed to connect to api.twitter.com port 443: Connection timed out'

我正在开发一个Codeigniter项目,在该项目中我使用twitterapi库来获取twitter数据。在我更改服务器之前它工作得很好,但是在更改服务器之后它产生了以下错误。我不知道问题所在。Fatalerror:Uncaughtexception'Exception'withmessage'Failedtoconnecttoapi.twitter.comport443:Connectiontimedout'in/my/project/path/myProject/application/ws/libraries/TwitterAPIExchange.php:297Stacktrac

php - PHP date_create() 上的 Twig 异常

我想根据她的生日计算一个选民的年龄,在我的实体中,我创建了一个这样的函数//voters.phppublicfunctiongetAge(){$birthday=$this->birthday;$age=date_diff(date_create($birthday),date_create('today'))->y;return$age;}我像这样在Twig中渲染它{{entity.getAge()}}但是显示如下错误:"Anexceptionhasbeenthrownduringtherenderingofatemplate("Warning:date_create()expect

php - SMTP 错误 : Could not connect to SMTP host. 邮件程序错误:SMTP 错误:无法连接到 SMTP 主机

大家好,我是php和html新手,面临问题:SMTP错误:无法连接到SMTP主机。邮件程序错误:SMTP错误:无法连接到SMTP主机。但在本地xampp中工作正常,在服务器中出现错误。代码如下:Name:$nameContact:$contactEmail:$emailCompany:$companyMessage:$message";require_once('mailer/class.phpmailer.php');$mail=newPHPMailer();$mail->IsSMTP();$mail->Host="smtp.gmail.com";$mail->SMTPDebug=0

php - 为什么 created_at updated_at 在插入时为空

在我的laravel项目中,我需要一次添加多条记录,我还想自动插入created_at和updated_at,因为它在save()中工作。但在插入方法中不起作用。for($i=0;$ilocation_id);$i++){$asset_arr[$i]['property_id']=$this->id;$asset_arr[$i]['location_id']=$req->location_id[$i];$asset_arr[$i]['model_id']=$req->model_id[$i];$asset_arr[$i]['appliance_owner']=$req->applian

php - WooCommerce 3.0 : can't find hook which corresponds to an admin created backend order

按照这个post的思路,当管理员使用我的支付网关通过管理面板创建订单时,我正在尝试连接到我自己的自定义支付网关。我添加了以下代码:add_action('woocommerce_process_shop_order_meta',array($this,'process_offline_order'));add_action('woocommerce_admin_order_actions_end',array($this,'process_offline_order2'));add_action('woocommerce_save_post_shop_order',array($thi

PHP Soap故障: Could not connect to host

类似这样的问题很多。但是我在尝试时没有得到解决方案。在下面找到我的代码:SOAPXML:xxxxxxxyyyyyyyy.....PHP代码:$client=newSoapClient({soapurl},$params);$auth=newstdClass();$auth->UserName='xxxxxxx';$auth->Password='yyyyyyyy';$header=newSoapHeader('NAMESPACE','Authentication',$auth,false);$client->__setSoapHeaders($header);$result=$clie

docker: Error response from daemon: driver failed programming external connectivity on endpoint tomc

docker:Errorresponsefromdaemon:driverfailedprogrammingexternalconnectivityonendpointtomcat1(9d06342addfe339a1bbf0876ae4534410f58cc65fa0b3b6516f282224af68202):(iptablesfailed:iptables--wait-tnat-ADOCKER-ptcp-d0/0--dport8080-jDNAT--to-destination172.17.0.2:8080!-idocker0:iptables:Nochain/target/matchb

PHP oci_connect() 卡住/没有超时

我们正在使用Lumen5.2.x(Laravel)应用程序从Oracle数据库获取数据。为此,我们使用oci_connect()连接到数据库。(额外信息:我们使用Oracleinstantclient)由于未知原因,应用程序没有响应并且不会返回任何数据。经过几个小时的调试,我们发现它卡在了同一个方法中:oci_connect()。显然该函数没有返回“超时”消息或任何类似的消息。后来好像是数据库搬到了别的主机上,就是连接不上的原因。但是,我们预计会出现错误,而不是大量等待。这就是我们试图强制设置超时的原因,直到现在还没有成功。我们尝试过的事情:将此添加到连接字符串:(CONNECT_TI

php - socket_connect 不会超时

我正在使用套接字将数据发送到可能没有响应的服务器。所以我试图通过在SO中使用此解决方案来定义超时。MakePHPsocket_connecttimeoutsocket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,array('sec'=>1,'usec'=>0));socket_set_option($socket,SOL_SOCKET,SO_SNDTIMEO,array('sec'=>1,'usec'=>0));这在建立连接并且服务器响应时间过长时有效。但是当它无法创建连接时socket_connect($socket,$addr,$port)