Setting It Up
PHP
Tutorial
- Run
sudo apt install php libapache2-mod-php -y
to 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/bin
to the$PATH
environment variable by editing the/etc/environment
file, if the~/composer/vendor/bin
directory does not exist check for~/.config/composer/vendor/bin
. - To create a new project run
laravel new myapp
or 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.