Class 'ZipArchive' not found 에러 발생! 도와주세요~~~ 채택완료
https://apachezone.com/qa/1290 에도 올린 질문입니다.
아파치님의 AAI 1.56을 이용하여 서버를 설치했고요.
경험 있으신 분의 조언을 부탁 드려요.
엑셀 업로드 후 업로드된 파일을 읽으려는데...
" Error loading file "20220127093532160305.xlsx": ZipArchive library is not enabled "
이런 에러가 발생하네요...
좀 더 조사해보니,
PHPExcel에서 에러가 나고 있군요.
// Check if zip class existsif (!class_exists('ZipArchive',FALSE)) {thrownewPHPExcel_Reader_Exception("ZipArchive library is not enabled");}
엑셀로 업로드 한 파일을 저 클래스가 읽어야 하는데, 클래스를 못찾고 있는 버그인듯 합니다.
에러로그...
/var/log/httpd/error_log <-- 여긴 별 내용 없고...
/var/log/httpd/******-error_log <-- 여기를 보면...
[Thu Jan 27 09:55:28.934478 2022] [:error] [pid 216599:tid 140243617404672] [client 121.139.158.55:53253] [client 121.139.158.55] ModSecurity: Warning. Pattern match "([\\\\~\\\\!\\\\@\\\\#\\\\$\\\\%\\\\^\\\\&\\\\*\\\\(\\\\)\\\\-\\\\+\\\\=\\\\{\\\\}\\\\[\\\\]\\\\|\\\\:\\\\;\\"\\\\'\\\\\\xc2\\xb4\\\\\\xe2\\x80\\x99\\\\\\xe2\\x80\\x98\\\\`\\\\<\\\\>].*?){4,}" at ARGS_NAMES:order[0][dir]. [file "/etc/httpd/modsecurity.d/activated_rules/modsecurity_crs_41_sql_injection_attacks.conf"] [line "159"] [id "981173"] [rev "2"] [msg "Restricted SQL Character Anomaly Detection Alert - Total # of special characters exceeded"] [data "Matched Data: ] found within ARGS_NAMES:order[0][dir]: order[0][dir]"] [ver "OWASP_CRS/2.2.9"] [maturity "9"] [accuracy "8"] [tag "OWASP_CRS/WEB_ATTACK/SQL_INJECTION"] [hostname "my-domain"] [uri "/InputList.php"] [unique_id "YfHtgEpbYZ6tfERzHdXWMwAAAM4"], referer: http://my-domain/Input.php
[Thu Jan 27 09:55:28.980463 2022] [:error] [pid 216599:tid 140243617404672] [client 121.139.158.55:53253] [client 121.139.158.55] ModSecurity: Warning. Operator GE matched 5 at TX:inbound_anomaly_score. [file "/etc/httpd/modsecurity.d/activated_rules/modsecurity_crs_60_correlation.conf"] [line "37"] [id "981204"] [msg "Inbound Anomaly Score Exceeded (Total Inbound Score: 240, SQLi=80, XSS=0): Restricted SQL Character Anomaly Detection Alert - Total # of special characters exceeded"] [hostname "my-domain"] [uri "/InputList.php"] [unique_id "YfHtgEpbYZ6tfERzHdXWMwAAAM4"], referer: http://my-domain/Input.php
Mod SEcurity에서 에러를 발생시키는 것 같은데...
에고 해결책을... ㅠㅠ
흠냐... 상용 서비스 중인데...
zip 라이브러리가 설치는 된 것 같은데,
phpinfo를 보면 정확하게 zip 라이브러리가 보이진 않네요. bZip만 보임...
답변 3개
phpinfo()에서 아래처럼 떠야죠. 보이지 않으면 당연히 설치되지 않은 것이니 추가 설치를 해야겠죠?

링크에 설치 관련 내용까지 다 있네요.
답변에 대한 댓글 6개
참고로 설치 후 웹 서버 재시작해줘야 합니다.
[root@아하하 /]# yum list installed | grep zip
bzip2.x86_64 1.0.6-13.el7 @base
bzip2-devel.x86_64 1.0.6-13.el7 @base
bzip2-libs.x86_64 1.0.6-13.el7 @anaconda
gzip.x86_64 1.5-10.el7 @anaconda
libzip5.x86_64 1.8.0-2.el7.remi @remi-safe
perl-Compress-Raw-Bzip2.x86_64 2.061-3.el7 @base
php54-php-pecl-zip.x86_64 1.20.0-1.el7.remi @remi-safe
php55-php-pecl-zip.x86_64 1.20.0-1.el7.remi @remi-safe
php56-php-pecl-zip.x86_64 1.20.0-1.el7.remi @remi-safe
php70-php-pecl-zip.x86_64 1.20.0-1.el7.remi @remi-safe
php71-php-pecl-zip.x86_64 1.20.0-1.el7.remi @remi-safe
php72-php-pecl-zip.x86_64 1.20.0-1.el7.remi @remi-safe
php73-php-pecl-zip.x86_64 1.20.0-1.el7.remi @remi-safe
php74-php-pecl-zip.x86_64 1.20.0-1.el7.remi @remi-safe
php80-php-pecl-zip.x86_64 1.20.0-1.el7.remi @remi-safe
unzip.x86_64 6.0-24.el7_9 @updates
zip.x86_64 3.0-11.el7 @base
zip.so 도 php.ini에 넣었구요...
php-fpm, httpd 다 재시작 했어요.
단, extension_dir를 어디에 넣어둔건지 확인을 못하고 있는 상황이긴 한데...
mysql이나 다른 모듈이 된다는건 설정이 되어 있다라고 가졍했을때
문제가 발생할 이유가 없어 보여서 더욱 답답한 상황이네요...
phpinfo(); 페이지에서 extension_dir 찾아보면 됩니다.
해당 위치에 .so 파일을….
이런 저런 걸 했더니...
[27-Jan-2022 03:05:30 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/lib64/php/modules/zip.so (/usr/lib64/php/modules/zip.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/zip.so.so (/usr/lib64/php/modules/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
이젠 이런 에러가 나네요...
차근차근 진행해보세요.
처음부터, 또는 다른 방식의 설치 등.
댓글을 작성하려면 로그인이 필요합니다.
댓글을 작성하려면 로그인이 필요합니다.
여전히 해결이 안되었네요...
서비스는 어케 저케 다시 살렸는데...
여전히 zip 라이브러리는 불러오지 못하고 있네요...
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인