Laravel PHP扩展已安装但未加载到VPS服务器

gzjq41n4  于 5个月前  发布在  PHP
关注(0)|答案(2)|浏览(61)

我在AlmaLinux 9上运行PHP版本8.3。我有一个Laravel 10项目,在我的Windows本地机器上运行得非常好,因为根据文档的所有要求都得到了满足。但是我在这里试图在我的VPS上做同样的事情,以便它也可以运行,但无济于事。问题是当我在ssh cli上运行php -m时,我清楚地看到,有一些缺少的扩展; mbstring和其他几个.安装它们与sudo dnf可以看到下面,响应是他们已经安装:

[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!

字符串
ssh上运行php -m得到:

[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]


在本地Windows机器上的php -m提供:

PS C:\Users\KlemLloydMwenya\webapps\my-app\backend\be-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]

我已经试过了:

  • 增加了php.ini文件的扩展,甚至用/sbin/service httpd restartsudo systemctl restart httpd重启服务器,甚至手动重启,以及系统重启WHM
  • 我关注和阅读的一些问题是:

1.第1期

  1. Issue 2
    我的php.ini的路径是/opt/cpanel/ea-php83/root/etc/php.ini
cwdobuhd

cwdobuhd1#

我的php.ini的路径是/opt/cpanel/ea-php 83/root/etc/php. ini
所以,你运行的不是AlmaLinux,而是一个被cpanel发行版严重改变的Linux。
dnf install php-bcmathphp-curl php-fileinfo php-mbstring php.
如果你没有使用这个PHP,这个命令是无用的。

which php
/usr/bin/php -m

字符串
您可能需要安装cpanel的扩展。

xriantvc

xriantvc2#

我发现有问题的PHP扩展是可用的,但需要在WHM中打开它们各自的安装按钮;然后配置它们以完全安装它们并使它们可用。

相关问题