草庐IT

err_connection_closed

全部标签

php - 有人可以解释一下关于 mysqli close 函数的声明吗?

在mysqli文档站点上列出,其中一条评论说Youshouldalwaysusemysqli_kill()functionbeforemysqli_close()toactuallycloseandfreeupthetcpsocketbeingusedbyPHP.Garbagecollectionafterscriptexecutionnormysqli_close()donotkillthetcpsocketontheirown.Thesocketwouldotherwiseremainin'wait'stateforapproximately30seconds,andanyaddi

php - pg_close 在使用持久的 postgres 连接时?

当使用pg_pconnect连接从php连接到postgres时,pg_close是否:真的关闭连接(破坏持久效果)?将连接移交给pconnect池? 最佳答案 与PHP.ini配置有关,如标签pgsql.allow_persistent设置为true那么pg_close将不会关闭连接,因为它是持久的,否则如果你将它设置为falsepg_close将关闭连接。文档说明pg-pconnect:pg_close()willnotclosepersistentlinksgeneratedbypg_pconnect()

php - 压缩存档 PHP : Close() returns false with no error message

我正在尝试使用基于数组结构的目录树创建一个zip文件。我已经在使用thisanswer当我需要从目录树创建一个zip文件时,但在这种情况下,所有文件都在同一目录中,目录树基于数据库中的其他数据。我已经检查过所有文件都在正确的路径中,并且foreach循环正在运行。$zip->close发生错误。这就是代码(原始数组在每一层都有很多条目):$zip_array=array('Level1'=>array('Level2'=>array('file1'=>'/var/www/html/pdf/683026577.pdf','file2'=>'/var/www/html/pdf/683026

PhpSpreadsheet:权限 | ZipArchive::close():创建临时文件失败

我想提供一个Excel文件供PhpSpreadsheet下载这是我的代码:require'vendor/autoload.php';usePhpOffice\PhpSpreadsheet\Spreadsheet;usePhpOffice\PhpSpreadsheet\Writer\Xlsx;$spreadsheet=newSpreadsheet();$sheet=$spreadsheet->getActiveSheet();$sheet->setCellValue('A1','HelloWorld!');$writer=newXlsx($spreadsheet);$writer=\Ph

php - mysql_connect 错误

在下面的代码中,我看到了echo1语句,之后我没有看到UI上打印任何内容。用户名和密码是正确的。但是PHP好像连不上MySQL。甚至看不到死亡声明我做错了什么。在遇到mysql_connect后,其余代码不起作用: 最佳答案 你应该错过了一个错误。添加:ini_set('display_errors',1);error_reporting(E_ALL);在脚本的开头 关于php-mysql_connect错误,我们在StackOverflow上找到一个类似的问题:

PHPMailer,Gmail 的 SMTP connect() 失败错误

我正在尝试创建一个联系表单,并且我正在使用PHPMailer。我在localhost上用xampp试过了,效果很好。但是当我上传到我的主机时,我收到错误SMTPconnect()failed。这是我的代码:$m=newPHPMailer;$m->isSMTP();$m->SMTPAuth=true;$m->Host="smtp.gmail.com";$m->Username="mymail@gmail.com";$m->Password="mypass";$m->SMTPSecure="ssl";$m->Port="465";$m->isHTML();$m->Subject="Hell

php - Composer : how to add a dependency without network connection?

我的专业网络阻止互联网访问。几个月前,我从存档(包含composer.json文件)和composer.phar的存档中下载了Silex框架,然后通过HDD将它们传输到我的桌面上。我自定义的composer.json:{"name":"user/silex","require":{"silex/silex":"1.2","twig/twig":">=1.8,它工作正常,我的自动加载定制也是如此。今天我想添加monolog/monolog包,所以我从另一台计算机手动导入它。我将它放入我的vendor文件夹中,并将以下行添加到我的composer.json文件中:,"monolog/mon

php - 何时调用 mysqli::close

我应该什么时候调用mysqli::close?我从来没有使用if语句来检查bind_param()、prep()和execute()是否成功。我应该在方法(下面)的末尾调用$stmt->close()吗?或者我应该在每个条件之后调用它确保我关闭数据库连接,即使进程在某个阶段失败,例如绑定(bind)参数。publicfunctionfunction_name($id,$new_id){$query="UPDATETABLESETname=?WHEREfield=?";if($stmt=$this->prepare($query)){if($stmt->bind_param("is",$

php - SMTP 错误 : Could not connect to SMTP host

我有这段代码,在我的本地服务器上一切正常。电子邮件发送没有任何问题。但是现在我将内容传递给网络服务器,我得到了这个错误...SMTPError:CouldnotconnecttoSMTPhost.服务器启用了SSL..正确吗?那么,问题是什么?$mail=newPHPMailer();$mail->IsSMTP();$mail->SMTPAuth=true;//enableSMTPauthentication$mail->SMTPSecure="ssl";//setstheprefixtotheservier$mail->Host="smtp.gmail.com";//setsGMAI

PHP 向服务器发送 XML 请求(TNT Express Connect 定价模块)

我尝试向TNTExpress连接定价模块服务发出httppost请求:$xml=''.PHP_EOL;$xml.=''.PHP_EOL;$xml.=''.PHP_EOL;$xml.='xxxxx'.PHP_EOL;$xml.='xxxxx'.PHP_EOL;$xml.=''.PHP_EOL;$xml.=''.PHP_EOL;$xml.=''.PHP_EOL;$xml.='1.0'.PHP_EOL;$xml.='1.0'.PHP_EOL;$xml.='1.0'.PHP_EOL;$xml.='1.0'.PHP_EOL;$xml.='1.0'.PHP_EOL;$xml.='1.0'.PHP_