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

gzjq41n4  于 2024-01-05  发布在  PHP
关注(0)|答案(2)|浏览(288)

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

  1. [user@235 ~]$ sudo dnf install php-bcmath php-curl php-fileinfo php-mbstring php-mysqlnd php-pdo_mysql php-zip
  2. [sudo] password for user:
  3. Last metadata expiration check: 4:25:36 ago on Fri 22 Dec 2023 01:05:30 AM UTC.
  4. Package php-bcmath-8.3.1-1.el9.remi.x86_64 is already installed.
  5. Package php-common-8.3.1-1.el9.remi.x86_64 is already installed.
  6. Package php-common-8.3.1-1.el9.remi.x86_64 is already installed.
  7. Package php-mbstring-8.3.1-1.el9.remi.x86_64 is already installed.
  8. Package php-mysqlnd-8.3.1-1.el9.remi.x86_64 is already installed.
  9. Package php-mysqlnd-8.3.1-1.el9.remi.x86_64 is already installed.
  10. Package php-pecl-zip-1.22.3-1.el9.remi.8.3.x86_64 is already installed.
  11. Dependencies resolved.
  12. Nothing to do.
  13. Complete!

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

  1. [root@235 ~]# php -m
  2. [PHP Modules]
  3. Core
  4. ctype
  5. date
  6. dom
  7. filter
  8. ftp
  9. hash
  10. json
  11. libxml
  12. openssl
  13. pcntl
  14. pcre
  15. Phar
  16. posix
  17. random
  18. readline
  19. Reflection
  20. session
  21. SimpleXML
  22. SPL
  23. standard
  24. tokenizer
  25. xml
  26. xmlreader
  27. xmlwriter
  28. xsl
  29. zlib
  30. [Zend Modules]


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

  1. PS C:\Users\KlemLloydMwenya\webapps\my-app\backend\be-a> php -m
  2. [PHP Modules]
  3. bcmath
  4. calendar
  5. Core
  6. ctype
  7. curl // <--- See this here
  8. date
  9. dom
  10. fileinfo
  11. filter
  12. hash
  13. iconv
  14. json
  15. libxml
  16. mbstring // <--- See this here
  17. mysqlnd
  18. openssl
  19. pcre
  20. PDO // <--- See this here
  21. pdo_mysql // <--- See this here
  22. Phar
  23. random
  24. readline
  25. Reflection
  26. session
  27. SimpleXML
  28. SPL
  29. standard
  30. tokenizer
  31. xml
  32. xmlreader
  33. xmlwriter
  34. zip
  35. zlib
  36. [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,这个命令是无用的。

  1. which php
  2. /usr/bin/php -m

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

xriantvc

xriantvc2#

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

相关问题