草庐IT

auto-close

全部标签

php - ZipArchive::close():重命名临时文件失败:权限被拒绝

当我尝试删除压缩目录中的文件时,我遇到了这个奇怪的错误:ZipArchive::close():Renamingtemporaryfilefailed:Permissiondeniedin/MyDirectory/myphpscript.php这是我的代码:open($compressedDirectoryPath)===true){if($zip->deleteName('SampleZip/samplefile.txt')===true){echo'Filedeleted';}}$zip->close();//theerrorispointinghere?>echo成功执行并打印F

PHP 注释格式 : auto generated or User created?

一直在php中看到这些header注释,经常想是不是用什么软件设置的?我好像记得JavaDoc什么的?但我不确定这是否是自动生成的?或者这只是某种类型的文档标准?下面的例子来自CodeIgniter:/***CodeIgniter**AnopensourceapplicationdevelopmentframeworkforPHP4.3.2ornewer**@packageCodeIgniter*@authorExpressionEngineDevTeam*@copyrightCopyright(c)2008,EllisLab,Inc.*@licensehttp://codeignit

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

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

php - SQL 插入 Auto_Increment 列

基本上,我有一个用于通用SQL语句的PHP类:object.table('table_name')用从table_schema中提取的'table_name'的列名填充一个数组object.insert(data_array)使用列数组和data_array将插入语句运行到'table_name'object.select('where')使用where语句输入或什么都不返回'table_name'中的所有内容我这样做是因为我很懒,我想让我的代码更漂亮。但是,模式查找会从我的表中返回ID列,这很好,因为有时我需要使用object.select()返回它。但是,它使object.inse

php_value auto_prepend - 导致 500 错误?

我有一个在.htaccess中使用以下内容的项目:php_valueauto_prepend_file/home/-path-here/prepend.php这在我的本地WAMP服务器和另一台服务器上工作正常,只是在这个新服务器上不行。我可以完全访问服务器。我在想我需要启用php_value类似php.ini或使用easyapache的东西吗? 最佳答案 要允许.htaccess文件中的php_value,AllowOverride该目录的指令必须适当配置。AllowOverrideAll会这样做,但那可能是一般的。再一次,我不知道

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 - apache 中的 php_value auto_prepend_file 如何与 php 一起工作,它是否始终保留在内存中?

我想知道autoprepend如何与php和httpd一起工作。它是加载文件一次还是每次调用脚本时加载它?如果我有一个从磁盘读取文件并使用auto_prepend加载它们的文件,它们是保留在内存中还是在每次调用时加载。我正在尝试加载文件并保留在内存中,并且只有在重新启动apache后才会重新加载。php_valueauto_prepend_file/path/to/file 最佳答案 auto_prepend_file导致命名文件在解析任何其他脚本之前被解析;将auto_prepend_file视为存在于所有其他脚本顶部的requi

php - iconv() : Wrong charset, 不允许从 `auto' 转换为 `utf-8//IGNORE'

我正在为我的Laravel4框架使用thujohn/PDF-l4插件。它在本地Windows环境中运行良好。但是当移动到我的Centos生产环境时,转换PDF时会抛出以下错误。"iconv():Wrongcharset,conversionfrom`auto'to`utf-8//IGNORE'isnotallowed"检查了我的php-mbstring,但没有发现任何错误。 最佳答案 请在CentOS上安装PHPmbstring和xml扩展 关于php-iconv():Wrongchar