我想实现的我将在PHP Web应用程序开发中使用PhpSpreadsheet,我试图配置要在服务器上启用PhpSpreadsheet所必需的PHP Zip扩展。我尝试了两种方法,但设置不好,所以我想告诉我解决方案和其他要检查的内容。我尝试的第一种方法在终端执行以下操作# yum install php71-php-pecl-zip.x86_64# cp /etc/opt/remi/php71/php.d/40-zip.ini /etc/php.d/40-zip.ini# systemctl stop httpd.service# systemctl start httpd.service从Web浏览器使用PhpSpreadsheet执行处理时,发生错误/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php: 71Class 'ZipArchive' not found我确认在终端上启用了Zip扩展名,但是我不知道原因。# php --infoAdditional. Ini files parsed =>··/etc/php.d/40-zip.ini··zipZip => enabledZip version => 1.15.2Libzip headers version => 1.3.2Libzip library version => 1.5.1zlibZLib Support => enabledStream Wrapper => compress.zlib: / /Stream Filter => zlib.inflate, zlib.deflateCompiled Version => 1.2.7Linked Version => 1.2.7Directive => Local Value => Master Valuezlib.output_compression => Off => Offzlib.output_compression_level => -1 => -1zlib.output_handler => no value => no value# php vendor / phpoffice / phpspreadsheet / samples / index.phpRequirement check:PHP 5.6.0 ... passedPHP extension XML ... passedPHP extension xmlwriter ... passedPHP extension mbstring ... passedPHP extension ZipArchive ... passedPHP extension GD (optional) ... passedPHP extension dom (optional) ... passed我尝试的第二种方法取消1st的设置后(卸载软件包,删除复制的文件)在终端上执行以下操作# yum install php71-php-devel.x86_64# yum install zlib-devel.x86_64# pecl install zip第三个命令中发生以下错误# pecl install zipNo releases available for package "pecl.php.net/zip"install failed由于上述错误,下载文件并执行phpize不会再次出现错误...# wget http://pecl.php.net/get/zip-1.15.2.tgz# phpizeCan not find PHP headers in /usr/include/phpThe php-devel package is required for use of this command.我不明白为什么在pecl install zip和中会发生错误phpize。附加信息(固件/工具版本等)操作系统:Red Hat Enterprise Linux Server 7.4(Maipo)PHP:7.1.14
- 2 回答
- 0 关注
- 347 浏览
添加回答
举报
0/150
提交
取消