Saya menjalankan laravel 5.4 pada server Ubuntu 16.04 dengan PHP7. mencoba menginstal cviebrock/eloquent-sluggable
paket melemparkan beberapa kesalahan:
pish@let:/home/sherk/ftp/www$ sudo composer require cviebrock/eloquent-sluggable
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^4.2 for cviebrock/eloquent-sluggable
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- phpunit/php-code-coverage 4.0.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/php-code-coverage 4.0.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- Installation request for phpunit/php-code-coverage (installed at 4.0.7) -> satisfiable by phpunit/php-code-coverage[4.0.7].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
- /etc/php/7.0/cli/conf.d/20-ctype.ini
- /etc/php/7.0/cli/conf.d/20-exif.ini
- /etc/php/7.0/cli/conf.d/20-fileinfo.ini
- /etc/php/7.0/cli/conf.d/20-ftp.ini
- /etc/php/7.0/cli/conf.d/20-gd.ini
- /etc/php/7.0/cli/conf.d/20-gettext.ini
- /etc/php/7.0/cli/conf.d/20-iconv.ini
- /etc/php/7.0/cli/conf.d/20-json.ini
- /etc/php/7.0/cli/conf.d/20-mbstring.ini
- /etc/php/7.0/cli/conf.d/20-mcrypt.ini
- /etc/php/7.0/cli/conf.d/20-mysqli.ini
- /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.0/cli/conf.d/20-phar.ini
- /etc/php/7.0/cli/conf.d/20-posix.ini
- /etc/php/7.0/cli/conf.d/20-readline.ini
- /etc/php/7.0/cli/conf.d/20-shmop.ini
- /etc/php/7.0/cli/conf.d/20-sockets.ini
- /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.0/cli/conf.d/20-sysvsem.ini
- /etc/php/7.0/cli/conf.d/20-sysvshm.ini
- /etc/php/7.0/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
Saya tidak punya masalah menginstal paket ini pada versi lokal dari aplikasi.
sudo
untuk menjalankan komposer, dapatkan kesalahan ini:Could not read /home/pish/.composer/auth.json file_get_contents(/home/pish/.composer/auth.json): failed to open stream: Permission denied
php-mbstring
paket, seharusnyasudo apt-get
. Selain itu; itu bekerja seperti pesona. Terima kasih!composer install
sudo phpenmod xml
dan lakukan hal yang sama untukxmlreader
&xmlwriter
. Kemudian restart server Anda (jika apache:)sudo service apache2 restart
dan coba instal lagi.Untuk siapa yang ingin menginstal ext-dom di php 7.1 dan menjalankan perintah ini:
sumber
sudo update-alternatives --set php /usr/bin/php7.0
,php-xml
akan unduhphp7.0-xml
. Jadi berhati-hatilah saat menggunakan pendekatan ini, saya akan selalu merekomendasikan pendekatanUntuk CentOS, RHEL, Fedora:
Kemudian pilih versi php-xml yang cocok dengan versi php Anda:
sumber
sudo apt install php-xml
akan bekerja tetapi masalahnya adalah akan mengunduh plugin untuk versi PHP terbaru.Jika versi PHP Anda bukan yang terbaru, maka Anda dapat menambahkan versi di dalamnya:
sumber
jalankan saja
ini bekerja untuk saya
sumber