2020-10-21 Start using Laravel

Create a project (this will be taking along). Composer (dependency management in PHP) can install just using apt. While creating laravel project will be download many packages.

$ composer create-project laravel/laravel my-laravel-project

Laravel Installation

The requirement

  • php7.4

  • composer

  • apache2, mysql-client, mysql-server, phpmyadmin

In my machine use php7.2, I will upgrade with this way

sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt remove php7.2
sudo apt-get purge php7.*
sudo apt install php7.4-cli php7.4-fpm php7.4-json php7.4-pdo php7.4-mysql php7.4-zip php7.4-gd  php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath php7.4-json

install laravel with composer composer global require laravel/installer

...
    Problem 1
    - Conclusion: don't install laravel/installer v4.0.5
    - Conclusion: don't install laravel/installer v4.0.4
...
    - Can only install one of: symfony/console[v4.0.0, v3.4.45].
    - Can only install one of: symfony/console[v4.0.1, v3.4.45].
...
    - Installation request for symfony/console (locked at v3.4.45) -> satisfiable by symfony/console[v3.4.45].


Installation failed, reverting ./composer.json to its original content.

an error solve method:

  1. run installation using additional option --update-with-all-dependencies

  2. delete folder /home/bima/.config/composer/vendor and update composer, with self-update or with new installation

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/bin/composer
$ sudo chmod +x /usr/bin/composer

After installation laravel OK let's export path ~/.config/composer/vendor/bin to use laravel

$ echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' > ~/.bashrc
$ source ~/.bashrc
$ laravel

Create simple project

laravel new cuekbebek

Last updated

Was this helpful?