I am running PHP version 8.3 on AlmaLinux 9. I have a Laravel 10 project that runs perfectly well on my Windows local machine because all the requirements according to documentation are met. But I am here trying to do the same on my VPS so that it too can run, but to no avail. The issue is when I run php -m
, on ssh cli
, I see clearly that, there are some missing extensions; mbstring
and a couple of others. Installing them with sudo dnf
as can be seen below, the response is they are already installed:
[user@235 ~]$ sudo dnf install php-bcmath php-curl php-fileinfo php-mbstring php-mysqlnd php-pdo_mysql php-zip
[sudo] password for user:
Last metadata expiration check: 4:25:36 ago on Fri 22 Dec 2023 01:05:30 AM UTC.
Package php-bcmath-8.3.1-1.el9.remi.x86_64 is already installed.
Package php-common-8.3.1-1.el9.remi.x86_64 is already installed.
Package php-common-8.3.1-1.el9.remi.x86_64 is already installed.
Package php-mbstring-8.3.1-1.el9.remi.x86_64 is already installed.
Package php-mysqlnd-8.3.1-1.el9.remi.x86_64 is already installed.
Package php-mysqlnd-8.3.1-1.el9.remi.x86_64 is already installed.
Package php-pecl-zip-1.22.3-1.el9.remi.8.3.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Running php -m
on ssh
gives:
[root@235 ~]# php -m
[PHP Modules]
Core
ctype
date
dom
filter
ftp
hash
json
libxml
openssl
pcntl
pcre
Phar
posix
random
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
xsl
zlib
[Zend Modules]
And php -m
on a local Windows machine gives:
PS C:UsersKlemLloydMwenyawebappsmy-appbackendbe-a> php -m
[PHP Modules]
bcmath
calendar
Core
ctype
curl // <--- See this here
date
dom
fileinfo
filter
hash
iconv
json
libxml
mbstring // <--- See this here
mysqlnd
openssl
pcre
PDO // <--- See this here
pdo_mysql // <--- See this here
Phar
random
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib
[Zend Modules]
What I have already tried:
- Added extensions to
php.ini
file, and even restarted the server with/sbin/service httpd restart
,sudo systemctl restart httpd
and even manually restarting, as well as system rebooting WHM. - Some of the issues I have followed and read are:
The path to my php.ini is /opt/cpanel/ea-php83/root/etc/php.ini
2
Answers
I found that the PHP extensions in question were available but needed to have their respective install buttons in WHM, toggled on; and then provision them to fully install them and make them available.
So, you are not running AlmaLinux but a heavily altered by cpanel distro.
This command is useless are you are not using this PHP.
Try
You probably need to install extensions for cpanel.