Install Laravel required PHP & Extentions

Following requirement part is taken from laravel official Laravel Installation documentation page. Purpose is to help beigners to prepare there local or remote envirement with php setup.

Server Requirements

The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the Laravel Homestead virtual machine, so it’s highly recommended that you use Homestead as your local Laravel development environment.

However, if you are not using Homestead, you will need to make sure your server meets the following requirements:

  • PHP >= 7.1.3
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension
  • Ctype PHP Extension
  • JSON PHP Extension


How to install PHP => 7.1 & required extentions?


Run following commands to install php >=7.1.3, use SUDO if you are not running commands as root user.

  •  Update Ubuntu
    apt-get update && apt-get upgrade
  • Add the PHP repository from Ondřej:
    • apt-get install python-software-properties
    • add-apt-repository ppa:ondrej/php
    • apt-get update
    • apt-get install php7.2
  • Extentions can be installed
    apt-get install php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml php-token-stream php7.2-json

That’s should be it, you machine will be ready with required php and extentions.

About the author

Danyal Ali Butt

I'm working as programmer since 2002. Born, grew up, studied and worked in Pakistan now Im located in Denmark since 2006.

View all posts