Setting It Up
PHP
Tutorial
- Run sudo apt install php libapache2-mod-php -yto install php and the php extension for apache2 if they are not installed yet.
- Install composer following the official guide.
- Install Laravel with the following command: $ composer global require laravel/installer.
- Make sure all the php extensions required by Laravel are installed running the following command: sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zip.
- Add the directory ~/composer/vendor/binto the$PATHenvironment variable by editing the/etc/environmentfile, if the~/composer/vendor/bindirectory does not exist check for~/.config/composer/vendor/bin.
- To create a new project run laravel new myappor alternativelycomposer create-project --prefer-dist laravel/laravel myapp.
- To run the application use the command php artisan serve, the output of the command will indicate the port on which the application is running.