简体   繁体   中英

Magento 2 installation on Manjaro (Arch Linux) ~ php extension missing

I am installing Magento 2 on my system and after a lot of fiddeling around, I finally got to the localhost setup wizard. The following problem occured in the readiness-check-install screen (there are a couple of solutions online, I already tried most of them):

在此处输入图片说明

ERROR: 1 missing PHP extensions: PHP Extension curl The important part is that I use Manjaro for this, which is an Arch Linux distro.

1: The thing is, that there is no php-curl package in the arch linux package store at all, I think the curl extension is already installed with php.

2: I checked my php.ini file and there is no line with extension=php_curl, just extension=curl.

3: php -m prints this:

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: I installed everything with brew for linux, so I can check the php package like this:

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)

I really don't know how I can prevent this error.

I believe ext-curl is part of Arch's core PHP package which is why you cannot find it in pacman. I don't think it is enabled by default, and you need to edit the appropriate /etc/php/php.ini file. You are probably looking to uncomment ;extension=curl in the php-fpm.ini. You may need to set extension_dir , but this is unlikely for Arch/pacman.

I just noticed that you are using brew for linux... why? Is this even supported by Arch? You can check the /home/linuxbrew/.linuxbrew/etc/php/7.3/ location and see why curl is not enabled, or just use pacman. Please note, there is a seperate ini file for the cli & fpm runtime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM