Skip to content

Instantly share code, notes, and snippets.

@jpalala
Last active October 26, 2022 04:53
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpalala/cc6d33d7f97fa526faf8f9a063d4841a to your computer and use it in GitHub Desktop.
Save jpalala/cc6d33d7f97fa526faf8f9a063d4841a to your computer and use it in GitHub Desktop.
Laravel 5.3 or 5.4 PHP modules requireed for Ubuntu and Centos

Laravel docs says the following is needed

  • PHP >= 5.6.4
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

Many packages need curl, so I suggest adding php-curl and uploading and manipulating images require the gd library, php-gd

First upgrade your system: sudo yum upgrade

Now let's install openssl php (provided by php-common) and php-mbstring (might already be installed) and curl

sudo yum install php-common

sudo yum install php-curl php-mbstring

sudo yum install php-mbstring

You sometimes also need mcrypt

sudo yum install php-mcrypt

Lets install php-json and php-intl and php-exif and php-tokenizer

sudo yum install php-json php-intl php-exif php-tokenizer

Since laravel has sockets support, we might need it, as well as XML

sudo yum php-sockets php-xml

To get it working with apache you'll need mod_php - install it by sudo apt-get install php5-mcrypt libapache2-mod-php

Apache also needs mod_rewrite, so install it by running: a2enmod rewrite

Installing PHP 7

For installing on Centos - this article on www.virtzone.net worked for me

For ubuntu with apache - sudo apt install php libapache2-mod-php7.0 && sudo a2enmod php7.0

Debugging

Run php -i | grep 'extension name' (replace extension name with one of the above extensions (remove the php-)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment