Zip Module Not loading PHP 8.0.12 - php

I am having an issue installing PHPOffice/PHPSpreadsheet on my production server using composer. When I run composer install or composer update I get the following
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires phpoffice/phpspreadsheet ^1.19.0 -> satisfiable by phpoffice/phpspreadsheet[1.19.0].
- phpoffice/phpspreadsheet 1.19.0 requires ext-zip * -> it is missing from your system. Install or enable PHP's zip extension.
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php.ini
- /etc/php.d/20-bcmath.ini
- /etc/php.d/20-bz2.ini
- /etc/php.d/20-calendar.ini
- /etc/php.d/20-ctype.ini
- /etc/php.d/20-curl.ini
- /etc/php.d/20-dom.ini
- /etc/php.d/20-exif.ini
- /etc/php.d/20-fileinfo.ini
- /etc/php.d/20-ftp.ini
- /etc/php.d/20-gd.ini
- /etc/php.d/20-gettext.ini
- /etc/php.d/20-iconv.ini
- /etc/php.d/20-mbstring.ini
- /etc/php.d/20-mysqlnd.ini
- /etc/php.d/20-pdo.ini
- /etc/php.d/20-phar.ini
- /etc/php.d/20-posix.ini
- /etc/php.d/20-shmop.ini
- /etc/php.d/20-simplexml.ini
- /etc/php.d/20-sockets.ini
- /etc/php.d/20-sodium.ini
- /etc/php.d/20-sqlite3.ini
- /etc/php.d/20-sysvmsg.ini
- /etc/php.d/20-sysvsem.ini
- /etc/php.d/20-sysvshm.ini
- /etc/php.d/20-tokenizer.ini
- /etc/php.d/20-xml.ini
- /etc/php.d/20-xmlwriter.ini
- /etc/php.d/20-xsl.ini
- /etc/php.d/30-mysqli.ini
- /etc/php.d/30-pdo_mysql.ini
- /etc/php.d/30-pdo_sqlite.ini
- /etc/php.d/30-xmlreader.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
bash-4.2$ composer install --with-all-dependencies
[Symfony\Component\Console\Exception\RuntimeException]
The "--with-all-dependencies" option does not exist.
install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-scripts] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>]...
I am running PHP 8.0, and when I installed it I installed php-zip
When I run php -m I get the following list
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
zlib
[Zend Modules]
I have tried everything I could possibly think of to enable the zip extension. I've even tried installing it again using sudo yum install php-zip and then attempting to enable it.
I installed my PHP stack using the following:
sudo yum -y install php php-{cli,fpm,mysqlnd,zip,devel,gd,mbstring,curl,xml,pear,bcmath,json}
after PHP was installed, I ran php -m and saw that the zip module was not loaded. I then ran sudo yum -y php-zip viewed the loaded modules again, and it still was not there. I then modified the php.ini file and added extension=php. After I ran php -v and I received this message
PHP Warning: PHP Startup: Unable to load dynamic library 'zip' (tried: /usr/lib64/php/modules/zip (/usr/lib64/php/modules/zip: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/zip.so (/usr/lib64/php/modules/zip.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.0.12 (cli) (built: Oct 19 2021 10:34:32) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.12, Copyright (c) Zend Technologies
This is the full list of commands I used to install PHP 8. I followed the directions from the this website: https://www.tecmint.com/install-php-8-on-centos/
here are the commands I used
sudo yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install yum-utils
sudo yum-config-manager --disable 'remi-php*'
sudo yum-config-manager --enable remi-php80
sudo yum -y install php php-{cli,fpm,mysqlnd,zip,devel,gd,mbstring,curl,xml,pear,bcmath,json}
Does anybody have any thoughts or ideas?

I was finally able to get the zip extension to load by installing the pecl zip module
sudo yum install php-pecl-zip Once it installed and I reloaded apache running php -m showed
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
zip
zlib
[Zend Modules]

Related

oci8.so is missing in php modules in Linux Centos 8

I'm having a problem to install oracle instant client in my linux server. Its already 5 days i'm stuck with it. I followed the tutorial but still didn't work.
https://medium.com/#azharnian/cara-install-oci8-php-7-di-centos7-851abbb5d15
https://gist.github.com/Yukibashiri/cebaeaccbe531665a5704b1b34a3498e
https://docs.oracle.com/en/database/oracle/oracle-database/19/lnoci/instant-client.html#GUID-96F664E7-AD1D-4FE4-BCE2-6D9687016A51
I've successfully install apache, php and mariaDB in server. I have no problem running my php and laravel in the server.
But my current problem when I install oracle instant client, i notice that oci8.so in /usr/lib64/php/modules is missing. When I run command pear download pecl/oci8 Error as below.
PHP Warning: PHP Startup: Unable to load dynamic library 'oci8.so' (tried: /usr/lib64/php/modules/oci8.so (/usr/lib64/php/modules/oci8.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/oci8.so.so (/usr/lib64/php/modules/oci8.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
ldap
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
How can I installed oci8.so in my php modules ? How can I check my OCI status.
Appreciate if someone can help me to solve this issue. Many thanks.
https://linux.uits.uconn.edu/2020/03/06/php-and-oci8-installation-for-rhel8/
This link is a step by step on how to install oci8
dnf install oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm oracle-instantclient18.5-devel-18.5.0.0.0-3.x86_64.rpm oracle-instantclient18.5-sqlplus-18.5.0.0.0-3.x86_64.rpm
dnf install libnsl
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
Install PHP and OCI8:
dnf module list php
dnf module enable php:remi-7.4 -y
(if you get the following message: “The operation would result in switching of module 'php' stream '7.2' to stream 'remi-7.4’”)
dnf module reset php (enter “y”)
dnf module enable php:remi-7.4 -y
dnf install -y php php-cli php-common php-fpm php-pear gcc curl-devel php-devel zlib-devel pcre-devel php-pecl-http systemtap-sdt-devel
export PHP_DTRACE=yes
setenforce 0
echo "instantclient,/usr/lib/oracle/18.5/client64/lib" | pecl install oci8-2.2.0.tgz
echo extension=oci8.so >> /etc/php.ini
echo extension=oci8 > /etc/php.d/20-oci8.ini
systemctl restart php-fpm
systemctl restart httpd

Using required CURL extension to install Valet

I am trying to install Valet on my laravel 6 project. So when I run composer global require cretueusebiu/valet-windows to install it, I get the following error:
requires ext-curl * -> the requested PHP extension curl is missing from your system.
However, extension=curl is enable in my php.ini file and also I run following command to check whether it is enable or nor:
<?php phpinfo() ?>
There also I can see the curl support is enable. What should I do to use Valet now? I am using Windows 10 and according to this answer, there is curl.exe but it does nothing with my expected answer.
and when I run php -m I get the following:
[PHP Modules]
bcmath
calendar
Core
ctype
date
dom
fileinfo
filter
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
Phar
readline
Reflection
session
SimpleXML
sockets
SPL
standard
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
[Zend Modules]
So there is no curl available. What do I do to get it?
ext-curl might not be enabled.
Try to enable:
$ sudo phpenmod curl
OR, install:
$ sudo apt install php[7.2,7.3]-curl
Repalce [7.2,7.3] from your installed PHP's version
You can use your OS package manager. Here I've used Aptitude for Debian

Missing PHP extension zip when trying to install laravel from composer [duplicate]

This question already has answers here:
install ext-zip for Mac
(12 answers)
Closed last month.
I have seen this question answered on other posts here, but none of the answers work for me. Mostly because I'm trying to install laravel locally on my mac and the answers are for Linux environments and brew claims it doesn't have this extension. Here is my output when I run the composer command:
$ composer global require "laravel/installer"
Changed current directory to /Users/frankaddelia/.composer
Using version ^2.0 for laravel/installer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/installer v2.0.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- laravel/installer v2.0.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- Installation request for laravel/installer ^2.0 -> satisfiable by laravel/installer[v2.0.0, v2.0.1].
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/php5/lib/php.ini
- /usr/local/php5/php.d/10-extension_dir.ini
- /usr/local/php5/php.d/20-extension-opcache.ini
- /usr/local/php5/php.d/40-curl.ini
- /usr/local/php5/php.d/40-openssl.ini
- /usr/local/php5/php.d/50-extension-apcu.ini
- /usr/local/php5/php.d/50-extension-curl.ini
- /usr/local/php5/php.d/50-extension-gmp.ini
- /usr/local/php5/php.d/50-extension-igbinary.ini
- /usr/local/php5/php.d/50-extension-imap.ini
- /usr/local/php5/php.d/50-extension-intl.ini
- /usr/local/php5/php.d/50-extension-mcrypt.ini
- /usr/local/php5/php.d/50-extension-mongodb.ini
- /usr/local/php5/php.d/50-extension-mssql.ini
- /usr/local/php5/php.d/50-extension-pdo_pgsql.ini
- /usr/local/php5/php.d/50-extension-pgsql.ini
- /usr/local/php5/php.d/50-extension-propro.ini
- /usr/local/php5/php.d/50-extension-raphf.ini
- /usr/local/php5/php.d/50-extension-readline.ini
- /usr/local/php5/php.d/50-extension-redis.ini
- /usr/local/php5/php.d/50-extension-xsl.ini
- /usr/local/php5/php.d/99-liip-developer.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
I try to install the missing extension with brew, but I get this error like so:
$ brew install php7.2-zip
Updating Homebrew...
Error: No available formula with the name "php7.2-zip"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
By the way, here is my php version:
php -v
PHP 7.3.0beta2 (cli) (built: Aug 21 2018 08:13:27) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.0beta2, Copyright (c) 1999-2018, by Zend Technologies
I can't seem to figure out how to get this missing extension and haven't found a solution that works for me after a few hours of googling. I just reformatted my mac dealing with a different server environment issue, so I don't mind reinstalling again and starting over, but I want to try to fix the issue without doing so if possible. Any help is greatly appreciated!
* EDIT *
Output for php -m
$ php -m
[PHP Modules]
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
igbinary
imap
intl
json
libxml
mbstring
mcrypt
mongodb
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
propro
raphf
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zlib
[Zend Modules]
Zend OPcache
At first you have to install php extension zip. To do the installation just run the following
sudo apt-get install php7.2-zip && sudo apt-get install php-zip
Now you can try again to install laravel installer using composer
Why does the composer error show that you are using php5?
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/php5/lib/php.ini
- /usr/local/php5/php.d/10-extension_dir.ini
- /usr/local/php5/php.d/20-extension-opcache.ini
- /usr/local/php5/php.d/40-curl.ini
- /usr/local/php5/php.d/40-openssl.ini
- /usr/local/php5/php.d/50-extension-apcu.ini
- /usr/local/php5/php.d/50-extension-curl.ini
- /usr/local/php5/php.d/50-extension-gmp.ini
- /usr/local/php5/php.d/50-extension-igbinary.ini
- /usr/local/php5/php.d/50-extension-imap.ini
- /usr/local/php5/php.d/50-extension-intl.ini
- /usr/local/php5/php.d/50-extension-mcrypt.ini
- /usr/local/php5/php.d/50-extension-mongodb.ini
- /usr/local/php5/php.d/50-extension-mssql.ini
- /usr/local/php5/php.d/50-extension-pdo_pgsql.ini
- /usr/local/php5/php.d/50-extension-pgsql.ini
- /usr/local/php5/php.d/50-extension-propro.ini
- /usr/local/php5/php.d/50-extension-raphf.ini
- /usr/local/php5/php.d/50-extension-readline.ini
- /usr/local/php5/php.d/50-extension-redis.ini
- /usr/local/php5/php.d/50-extension-xsl.ini
- /usr/local/php5/php.d/99-liip-developer.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Are you using php5 before? If yes, I think you can try uninstall the php5 first.
Run this on terminal:
sudo apt-get install php7.2-zip && sudo apt-get install php-zip.
After which you would run the command (sudo composer global require "laravel/installer")

How to enable php5-redis using cli?

I have a docker container where I see all php modules:
root#7b995118fc27:~# php -m
[PHP Modules]
Core
ctype
curl
date
dom
ereg
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib
[Zend Modules]
As we can see there is no php5-redis in that list.
When I try to install it I get a message saying it is already installed:
root#7b995118fc27:~# apt-get install php5-redis
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-redis is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
My php version is 5.6
root#7b995118fc27:~# php -v
PHP 5.6.31 (cli) (built: Sep 15 2017 01:12:36)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
So the only conclusion (if Im not wrong) is that the php5-redis is installed but not enabled.
This is what I have in the Dockerfile:
FROM php:5-apache
RUN a2enmod rewrite
RUN a2enmod expires
RUN service apache2 restart
RUN apachectl -M
RUN apt-get update
RUN apt-get install -y php5-redis
RUN apt-get install -y redis-server
RUN php -m
COPY src/ /var/www/html
EXPOSE 80
CMD ["redis-server"]
So, how can I enable php5-redis in this scenario?
You would need to add below statement to enable the redis extension
RUN cp /etc/php5/mods-available/redis.ini /usr/local/etc/php/conf.d && ln -s /usr/lib/php5/20131226/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20131226/redis.so

The json extension is missing. Please check your PHP configuration

I install PHP5.6.0 on Ubuntu 13.10 x64 from this
https://launchpad.net/~ondrej/+archive/php5-5.6a
then I installed phpmyadmin when I am trying to lunch phpmyadmin I got this message
The json extension is missing. Please check your PHP configuration.
my PHP modules:
bcmath
bz2
calendar
Core
ctype
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
libxml
mbstring
mcrypt
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
then when i use this command to install php-json
sudo apt-get install php5-json
I got this
The following packages have unmet dependencies:
php5-json : Depends: phpapi-20121212
E: Unable to correct problems, you have held broken packages.
How can I fix this problem?
It looks like you are install PHP5 from a custom repo. I would remove PHP and remove that repo.
sudo apt-add-repository --remove ppa:ondrej/php5-5.6
sudo apt-get update
now install php
sudo apt-get install php5-common php5-json
Below solution worked for me-
cd /etc/php5/mods-available
vi json.ini
In this file make below changes
priority=20
extension=json.so
Incase if json.ini file is not there, create the file with contents as
priority=20
extension=json.so
The problem seems to me to be because of Ubuntu's default permissions for the php.ini files. It only allows Root to read/execute the directories holding the in files.
You can easily verify this by observing that when you execute:
sudo php -m
You see all installed and enabled modules listed correctly.
The solution to this I have found on ubuntu distros is to:
sudo chmod a+rx /etc/php5/cli/
sudo chmod a+rx /etc/php5/cli/php.ini
sudo chmod a+rx /etc/php5/cli/conf.d/
Then you can easily verify by running:
php -m
It worked for me after loading the installed modules json and mcrypt.
$ sudo php5enmod json && sudo php5enmod mcrypt $ sudo service apache2 restart
Go to http://yourserver/phpmyadmin and take a look to check if it works.

Categories