Starting LEMP Build from Scratch

My boss wants to setup the base architecture to rebuild an existing application.

The Idea is to convert an existing, MS based, web forms app to CakePHP. I have some experience building up a LAMP server; however, the boss is demanding a Cent OS 7 server running Nginx as the base.

I have been using Google-Fu and there are tons of articles out there regarding how to set this up, but nothing seems to work.

Is there anyone else out there that has run into something similar?

“but nothing seems to work.” What exactly doesn’t work? The whole server setup or just the CakePHP application?

We started by creating a virtual machine on VM Ware Workstation: 8GB RAM, 2 CPU, 40GB Storage Volume. (This was a test machine just to gain viability)

We ran the installation from CentOS-7-x86_64-NetInstall-1511.iso and updated settings in the installer.

After installation, ran yum update, set NGINX repo, then used the following command:
sudo yum install nginx php-fpm php-cli php-mysql php-gd php-ldap php-odbc php-pdo php-pecl-memcache php-pear php-mbstring php-intl php-xml php-xmlrpc php-snmp php-soap mariadb mariadb-server net-tools wget curl unzip git

Update php.ini, nginx.conf, php-fpm.d/www.conf, and nginx/conf.d/default.conf

Went through the MariaDB setup, enabled firewall settings, created application database and user.

Verified that I could load the default index.html from Nginx

Ran composer to create the new app.

Reset the default.conf to point to the app folder.

The page start to load then gets an error with FileEngine. After hours of searching, (thought is was permissions, so did every other web search) turns out that the default repository from CentOS points to PHP 5.1. I get that updated and proceed to get PHP and MariaDB working again…

tl;dr; Issues creating a LEMP Server using CentOS. Does a setup guide exist to create a LEMP Server using CentOS7?

You can try with remi repos

1 Like

CentOS is known to have outdated libs. It will make things much easier if you use Debain or Ubuntu. Latest Ubuntu 16.04 LTS release has PHP 7 as default. Installing additional extensions like intl, mbstring which CakePHP requires would also require a single command like sudo apt-get install php-intl php-mbstring. Here’s a LEMP setup tutorial for ubuntu 16.04 you could follow

We run CentOS 6.5 in a production environment with PHP 5.5. You’ll definitely want to use the remi repository to install a more recent version of PHP.