gpt4 book ai didi

php - 在 Manjaro (Arch Linux) 上安装 Magento 2 ~ 缺少 php 扩展

转载 作者:行者123 更新时间:2023-12-04 10:46:32 25 4
gpt4 key购买 nike

我正在我的系统上安装 Magento 2,经过大量摆弄之后,我终于进入了 localhost 设置向导。在准备检查安装屏幕中出现以下问题(网上有几个解决方案,我已经尝试了其中的大部分):

enter image description here

错误: 1 个缺少的 PHP 扩展:PHP 扩展 curl
重要的是我为此使用了 Manjaro,这是一个 Arch Linux 发行版。

1:问题是,有 没有 php-curl 包 在 arch linux 软件包商店中,我认为 curl 扩展已经与 php 一起安装了。

2:我检查了我的 php.ini 文件,有 没有线使用 extension=php_curl,只是 extension=curl。

3: php -m 打印这个:

php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
ldap
libxml
mbstring
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
phpdbg_webhelper
posix
pspell
readline
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

4:我用 brew for linux 安装了所有东西,所以我可以像这样检查 php 包:
brew info php@7.3
php@7.3: stable 7.3.13 (bottled) [keg-only]
General-purpose scripting language
https://www.php.net/
/home/linuxbrew/.linuxbrew/Cellar/php@7.3/7.3.13 (520 files, 86.2MB)
Poured from bottle on 2020-01-10 at 10:32:22
From: https://github.com/Homebrew/linuxbrew-core/blob/master/Formula/php@7.3.rb
==> Dependencies
Build: httpd ✘, pkg-config ✘, xz ✔
Required: apr ✔, apr-util ✔, argon2 ✔, aspell ✔, autoconf ✔, curl-openssl ✔, freetds ✔, freetype ✔, gettext ✔, glib ✔, gmp ✔, icu4c ✔, jpeg ✔, libpng ✔, libpq ✔, libsodium ✔, libzip ✔, openldap ✔, openssl@1.1 ✔, sqlite ✔, tidy-html5 ✔, unixodbc ✔, webp ✔, bzip2 ✔, libedit ✔, libxml2 ✔, libxslt ✔, zlib ✔
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php7_module /home/linuxbrew/.linuxbrew/opt/php@7.3/lib/httpd/modules/libphp7.so

<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
/home/linuxbrew/.linuxbrew/etc/php/7.3/

php@7.3 is keg-only, which means it was not symlinked into /home/linuxbrew/.linuxbrew,
because this is an alternate version of another formula.

If you need to have php@7.3 first in your PATH run:
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/php@7.3/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/php@7.3/sbin:$PATH"' >> ~/.zshrc

For compilers to find php@7.3 you may need to set:
export LDFLAGS="-L/home/linuxbrew/.linuxbrew/opt/php@7.3/lib"
export CPPFLAGS="-I/home/linuxbrew/.linuxbrew/opt/php@7.3/include"


Warning: php@7.3 provides a launchd plist which can only be used on macOS!
You can manually execute the service instead with:
php-fpm
==> Analytics
install: 75 (30 days), 96 (90 days), 96 (365 days)
install-on-request: 75 (30 days), 96 (90 days), 96 (365 days)
build-error: 0 (30 days)

我真的不知道如何防止这个错误。

最佳答案

我相信 ext-curl 是 Arch 核心 PHP 包的一部分,这就是为什么你在 pacman 中找不到它的原因。我不认为它是默认启用的,您需要编辑相应的/etc/php/php.ini 文件。您可能希望取消注释 ;extension=curl在 php-fpm.ini 中。您可能需要设置 extension_dir ,但这对 Arch/pacman 来说不太可能。

我刚刚注意到你在 linux 上使用 brew ......为什么?这甚至得到 Arch 的支持吗?您可以检查/home/linuxbrew/.linuxbrew/etc/php/7.3/位置并查看未启用 curl 的原因,或者仅使用 pacman。请注意,cli 和 fpm 运行时有一个单独的 ini 文件。

关于php - 在 Manjaro (Arch Linux) 上安装 Magento 2 ~ 缺少 php 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59680482/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com