htdocs 폴더에 laravel 프로젝트를 만드는 방법

htdocs 폴더에 laravel 프로젝트를 만드는 방법

저는 웹 개발자입니다. Windows OS에서 프로젝트를 생성했지만 이제 완전히 Ubuntu 20.04로 전환했습니다. PHP와 composer. 하지만 Laravel 프로젝트를 생성하려고 하면 htdocs프로젝트가 생성되지만 vendor폴더가 없습니다. 폴더 composer update에 CLI를 작성하면 다음 오류가 표시됩니다.htdocs

1=>
Cannot create cache directory /home/saad/.cache/composer/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/saad/.cache/composer/files/, or directory is not writable. Proceeding without cache

2=>
PHP temp directory (/tmp) does not exist or is not writable to Composer. Set sys_temp_dir in your php.ini

3=>
Your requirements could not be resolved to an installable set of packages.

그런 다음 다음을 보여줍니다.

Problem 1
    - laravel/framework v7.25.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v7.24.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework 7.x-dev requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - Installation request for laravel/framework ^7.24 -> satisfiable by laravel/framework[7.x-dev, v7.24.0, v7.25.0].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.4/cli/php.ini
    - /etc/php/7.4/cli/conf.d/10-opcache.ini
    - /etc/php/7.4/cli/conf.d/10-pdo.ini
    - /etc/php/7.4/cli/conf.d/20-bcmath.ini
    - /etc/php/7.4/cli/conf.d/20-calendar.ini
    - /etc/php/7.4/cli/conf.d/20-ctype.ini
    - /etc/php/7.4/cli/conf.d/20-exif.ini
    - /etc/php/7.4/cli/conf.d/20-ffi.ini
    - /etc/php/7.4/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.4/cli/conf.d/20-ftp.ini
    - /etc/php/7.4/cli/conf.d/20-gettext.ini
    - /etc/php/7.4/cli/conf.d/20-iconv.ini
    - /etc/php/7.4/cli/conf.d/20-json.ini
    - /etc/php/7.4/cli/conf.d/20-phar.ini
    - /etc/php/7.4/cli/conf.d/20-posix.ini
    - /etc/php/7.4/cli/conf.d/20-readline.ini
    - /etc/php/7.4/cli/conf.d/20-shmop.ini
    - /etc/php/7.4/cli/conf.d/20-sockets.ini
    - /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.4/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.4/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.4/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.

답변1

Composer를 실행하려면 프로젝트 폴더로 들어가야 합니다.

예:

cd path/to/htdocs/your-laravel-project-folder

그런 다음 실행

composer install

답변2

문제 중 하나는 composer에 대한 쓰기 권한이 없다는 것입니다 /home/saad/.cache/composer/.

또 다른 문제는 패키지가 누락되었다는 것입니다 php-mbstring. 다음 방법으로 설치하세요.

sudo apt install php7.4-mbstring

관련 정보