我使用的是Ubuntu 17.04。我試圖訪問和/etc/php/7.0/cli和編輯php.ini文件。但無論如何沒有幫助。如何啓用這些擴展。在Ubuntu中創建Laravel應用程序時出現錯誤
[email protected]:~/Documents/lartest$ laravel new demo
Crafting application...
Cannot create cache directory /home/ninja/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/ninja/.composer/cache/files/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/ninja/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for phpunit/php-code-coverage 4.0.8 -> satisfiable by phpunit/php-code-coverage[4.0.8].
- phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 2
- Installation request for phpunit/phpunit 5.7.21 -> satisfiable by phpunit/phpunit[5.7.21].
- phpunit/phpunit 5.7.21 requires ext-dom * -> the requested PHP extension dom is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.0/cli/php.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-curl.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-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-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
- /etc/php/7.0/cli/conf.d/20-zip.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Application ready! Build something amazing.
也越來越錯誤而執行即成命令
[email protected]:~/Documents/lartest/demo$ php artisan serve
PHP Warning: require(/home/ninja/Documents/lartest/demo/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/ninja/Documents/lartest/demo/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/home/ninja/Documents/lartest/demo/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php') in /home/ninja/Documents/lartest/demo/bootstrap/autoload.php on line 17
https://stackoverflow.com/questions/44952650/the-requested-php-extension-dom-is-missing-from-your-系統 – Axalix