2

Using ubuntu 16.04 LTS, Installed PHP in two places with different version, in root 7.0 and XAMPP 5.6 , the composer installed globally, now I am not able to create project by composer from lamp/htdocs.

  • xampp running fine.
  • composer installed and running fine.

Error :

Notebook-PC:/opt/lampp/htdocs$ composer create-project --prefer-dist laravel/laravel blog "5.4.*"
Installing laravel/laravel (v5.4.30)
  - Installing laravel/laravel (v5.4.30): Loading from cache
Created project in blog
> php -r "file_exists('.env') || copy('.env.example', '.env');"
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
    - laravel/framework v5.4.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.36 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.35 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.34 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.33 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.32 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.31 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.30 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.29 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.27 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.26 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.25 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.24 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.23 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.22 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.20 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.19 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.18 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.17 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.14 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.13 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.12 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.11 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.4.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - Installation request for laravel/framework 5.4.* -> satisfiable by laravel/framework[v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9].

  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-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-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.

Checked by enable and disable php_mbstring.dll from root php.ini but getting same error. how can I solve this issue ?

10
  • @parthu_panther - getting error Composer could not find a composer.json file in /home/username To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section Commented May 19, 2018 at 9:58
  • what is the command that you used to create new project when this error striked? Commented May 19, 2018 at 10:20
  • @parthu_panther - composer create-project --prefer-dist laravel/laravel blog "5.4.*" Commented May 19, 2018 at 10:21
  • after changine php.ini dont forget to restart Commented May 19, 2018 at 10:25
  • 1
    I would prefer the latest xamp version with php 7.2+. it improves performance. mbstring will be by default installed with that. Also the laravel version 5.4 requires php>=5.6.4 which is not satisfied with your current 5.6 version. So latest version of xampp with php 7.2+ would be fine for both the packages, dependencies and not to forget it will simultaneously increase your performance. Commented May 22, 2018 at 7:35

1 Answer 1

1

Uninstalled XAMP and Installed LAMP in different way, but got the same issue :

sudo apt install lamp-server^

then solved by enable php mods :

sudo phpenmod mcrypt
sudo phpenmod mbstring
sudo a2enmod rewrite
sudo systemctl restart apache2

Followed : https://askubuntu.com/a/767970/509965

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.