我有一个问题,我在Linux服务器上安装'Archive_Zip 0.1.1',但是当我尝试运行脚本来创建zip文件时,它会给出致命的错误
致命错误:
ZipArchive在...中找不到类
我把代码放在哪里
$zip = new ZipArchive;
var_dump($zip);
$res = $zip->open($filename, ZipArchive::OVERWRITE);
if ($res !== TRUE) {
echo 'Error: Unable to create zip file';
exit;
}
if (is_file($src)) {
$zip->addFile($src);
} else {
// echo "<br>" . dirname(__FILE__) . $src;//'/install1';
if (!is_dir($src)) {
$zip->close();
@unlink($filename);
echo 'Error: File not found';
exit;
}
recurse_zip($src, $zip, $path_length);
}
$zip->close();
echo "<br>file name ".$filename;
Run Code Online (Sandbox Code Playgroud)
但它找不到类文件.
请告诉我解决方案.我该怎么做才能解决问题?我也把php.ini文件放到脚本所在的文件夹中,但它不起作用.
我试图在具有最新WordPress的nginx Web服务器上安装ziparchive和domdocument.为了运行Avada主题,我需要在本地CentOS 7测试服务器上使用这两个.我正在寻找过去3天的答案.我该怎么办?
以下是"已安装的yum列表:"的部分列表
php-common.x86_64 7.2.3-2.el7.remi @remi-php72<BR>
php-fpm.x86_64 7.2.3-2.el7.remi @remi-php72<BR>
php-json.x86_64 7.2.3-2.el7.remi @remi-php72<BR>
php-mysqlnd.x86_64 7.2.3-2.el7.remi @remi-php72<BR>
php-pdo.x86_64 7.2.3-2.el7.remi @remi-php72<BR>
php72.x86_64 1.0-1.el7.remi @remi-safe<BR>
php72-php-cli.x86_64 7.2.3-2.el7.remi @remi-safe<BR>
php72-php-common.x86_64 7.2.3-2.el7.remi @remi-safe<BR>
php72-php-json.x86_64 7.2.3-2.el7.remi @remi-safe<BR>
php72-php-mbstring.x86_64 7.2.3-2.el7.remi @remi-safe<BR>
php72-php-pear.noarch 1:1.10.5-6.el7.remi @remi-safe<BR>
php72-php-process.x86_64 7.2.3-2.el7.remi @remi-safe<BR>
php72-php-xml.x86_64 7.2.3-2.el7.remi @remi-safe<BR>
php72-runtime.x86_64 1.0-1.el7.remi @remi-safe<BR>
unzip.x86_64 6.0-16.el7 @base<BR>
Run Code Online (Sandbox Code Playgroud)