{"id":1609,"date":"2022-07-26T21:56:48","date_gmt":"2022-07-26T21:56:48","guid":{"rendered":"https:\/\/www.webhi.com\/how-to\/?p=1609"},"modified":"2022-09-02T10:00:56","modified_gmt":"2022-09-02T10:00:56","slug":"installation-of-nginx-mysql-php-lemp-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/","title":{"rendered":"Installation of Nginx, MySQL, PHP (LEMP) on CentOS 7"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/lemp_centos_en.jpg\" alt=\"Install Nginx, MySQL, PHP (LEMP) on CentOS 7 and CentOS 6\" class=\"wp-image-1611\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/lemp_centos_en.jpg 1200w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/lemp_centos_en-300x169.jpg 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/lemp_centos_en-1024x576.jpg 1024w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/lemp_centos_en-768x432.jpg 768w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/lemp_centos_en-150x84.jpg 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;<strong>LEMP<\/strong> software is a group of open source softwares that is usually installed at the same time to enable a host server&#8217;s dynamic websites and web applications. This term is actually an acronym that represents the <strong>L<\/strong>inux operating system, with the <strong>E<\/strong><a href=\"https:\/\/nginx.org\/\">N<\/a><a href=\"https:\/\/nginx.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">ginx<\/a> web server. The site data is stored in a <a href=\"https:\/\/www.mysql.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>M<\/strong>ySQL<\/a> (or MariaDB) database and the dynamic content is processed by <a href=\"https:\/\/www.php.net\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>P<\/strong>HP<\/a>.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;We will get in this LEMP guide with PHP 7.4 installed on a CentOS 7 server, using MySQL as the database management system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Requirement<\/h2>\n\n\n\n<p>You must have a different, non-root user account on your server before proceeding with this instruction.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1 \u2013 Nginx installation<\/h2>\n\n\n\n<p>We will use Nginx, a high-performance web server, to serve web pages to site visitors. To obtain the most recent version of Nginx, we will first install the EPEL repository, which offers extra software for the CentOS 7 operating system.<\/p>\n\n\n\n<p>Run the following command to add the CentOS 7 EPEL repository:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo yum install epel-release<\/code><\/pre>\n\n\n\n<p>Because we&#8217;re using the sudo command, these commands&nbsp;are carried out with root privileges. It will prompt you for your normal user password in order to confirm that you have authorization to run commands with root capabilities. When prompted to confirm the installation, press <code>Y<\/code> to proceed.<\/p>\n\n\n\n<p>Now that the EPEL repository has been installed on your server, use the following yum command to install Nginx:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo yum install nginx<\/code><\/pre>\n\n\n\n<p>Start the service using Nginx after the installation is complete:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo systemctl start nginx<\/code><\/pre>\n\n\n\n<p>You may immediately test that everything is working properly by accessing your server&#8217;s public IP address in your web browser.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Navigate in a web browser to this URL :\nhttp:\/\/server_public_IP\/<\/pre>\n\n\n\n<p>The&nbsp;default&nbsp;CentOS&nbsp;7&nbsp;Nginx&nbsp;web&nbsp;page&nbsp;will&nbsp;be&nbsp;shown&nbsp;for demonstration&nbsp;and&nbsp;testing&nbsp;purposes.&nbsp;<\/p>\n\n\n\n<p>The page is similar to this one :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1733\" height=\"722\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/centos-7-nginx.png\" alt=\"Nginx Default html on centos - Webhi\" class=\"wp-image-1626\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/centos-7-nginx.png 1733w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/centos-7-nginx-300x125.png 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/centos-7-nginx-1024x427.png 1024w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/centos-7-nginx-768x320.png 768w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/centos-7-nginx-1536x640.png 1536w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/centos-7-nginx-150x62.png 150w\" sizes=\"(max-width: 1733px) 100vw, 1733px\" \/><\/figure>\n\n\n\n<p>If you reach this page, your web server has been successfully deployed.<\/p>\n\n\n\n<p>Run the following command to enable Nginx start on boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo systemctl enable nginx<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2 \u2013 MySQL installation<\/h2>\n\n\n\n<p>For a complete guide, follow steps in this tutorial: <a href=\"https:\/\/www.webhi.com\/how-to\/installing-mysql-on-centos-rhel-7-6-fedora-31-30\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install MySQL on CentOS\/Redhat 7\/6 &amp; Fedora 31\/30<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3 \u2013 Install PHP<\/h2>\n\n\n\n<p>PHP is the part of our system that will process the code in order to show dynamic content. It can execute scripts, connect to our MySQL databases for information, and then provide the processed data to our web server for display.<\/p>\n\n\n\n<p>Because the PHP version supplied by default on CentOS 7 servers is out of date, we&#8217;ll need to install a third-party package repository in order to download and install PHP 7+ on your CentOS 7 server. <a href=\"https:\/\/rpms.remirepo.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">Remi<\/a> is a prominent package repository that offers the most recent PHP versions for CentOS machines.<\/p>\n\n\n\n<p>Run the following command to install the Remi repository for CentOS 7:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo yum install http:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm<\/code><\/pre>\n\n\n\n<p>Once installation is complete, you must run a command to enable the repository containing your preferred version of PHP. To verify that PHP 7+ releases are available in the Remi repository, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ yum --disablerepo=\"*\" --enablerepo=\"remi-safe\" list php[7-9][0-9].x86_64<\/code><\/pre>\n\n\n\n<p>You will see the following output:<\/p>\n\n\n\n<h5 class=\"has-text-align-center wp-block-heading\"><kbd>Output :<\/kbd><\/h5>\n\n\n\n<pre class=\"wp-block-preformatted\">Loaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * remi-safe: mirrors.ukfast.co.uk\nAvailable Packages\nphp70.x86_64            2.0-1.el7.remi                    remi-safe\nphp71.x86_64            2.0-1.el7.remi                    remi-safe\nphp72.x86_64            2.0-1.el7.remi                    remi-safe\nphp73.x86_64            2.0-1.el7.remi                    remi-safe\nphp74.x86_64            1.0-3.el7.remi                    remi-safe\nphp80.x86_64            1.0-3.el7.remi                    remi-safe<\/pre>\n\n\n\n<p>In this tutorial, we will install PHP 7.4. To obtain PHP 7.4, use the following command to activate the proper Remi package:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo yum-config-manager --enable remi-php74<\/code><\/pre>\n\n\n\n<p>Now, we can use yum to install PHP as usual. The following command will install all of the packages required to get PHP 7.4 working in Nginx and connected to MySQL-based databases:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo yum install php php-mysqlnd php-fpm<\/code><\/pre>\n\n\n\n<p>To ensure that PHP is installed as your preferred version, execute:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ php --version<\/code><\/pre>\n\n\n\n<h5 class=\"has-text-align-center wp-block-heading\"><kbd>Output :<\/kbd><\/h5>\n\n\n\n<pre class=\"wp-block-preformatted\">PHP 7.4.8 (cli) (built: Jul 9 2020 16:09:41) (NTS)\nCopyright (c) The PHP Group\nZend Engine v3.4.0, Copyright (c) Zend Technologies\n  with Zend OPcache v7.4.21, Copyright (c), by Zend Technologies<\/pre>\n\n\n\n<p>PHP has now been installed successfully on your machine. Following that, we must make a few changes to the default setup. To make file editing on CentOS easier, we&#8217;ll first install nano, a more user-friendly text editor than vi:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo yum install nano<\/code><\/pre>\n\n\n\n<p>Edit the <code>\/etc\/php-fpm.d\/www.conf<\/code> configuration file in <code>nano<\/code> or your preferred text editor:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo nano \/etc\/php-fpm.d\/www.conf<\/code><\/pre>\n\n\n\n<p>Examine the user and group directives now. If you&#8217;re using nano, you may search for these phrases within the current file by using <code>CTRL + W<\/code>.<\/p>\n\n\n\n<h5 class=\"has-text-align-center wp-block-heading\"><kbd>Output :<\/kbd><\/h5>\n\n\n\n<pre class=\"wp-block-preformatted\">\u2026\nuser = <strong>apache<\/strong>\ngroup = <strong>apache<\/strong>\n\u2026<\/pre>\n\n\n\n<p>We need to change these to&nbsp;<code>nginx<\/code>:<\/p>\n\n\n\n<h5 class=\"has-text-align-center wp-block-heading\"><kbd>Output :<\/kbd><\/h5>\n\n\n\n<pre class=\"wp-block-preformatted\">\u2026\nuser = <strong>nginx<\/strong>\ngroup = <strong>nginx<\/strong>\n\u2026<\/pre>\n\n\n\n<p>Locate the <code>listen<\/code> directive next. <code>php-fpm<\/code> will listen on a given host and port via <code>TCP<\/code> by default. We wish to update this option so that it listens on a local socket file, as this increases the server&#8217;s overall speed. <\/p>\n\n\n\n<p>Find the directives <code>listen.owner<\/code>, <code>listen.group<\/code>, and <code>listen.mode<\/code>. By default, these lines are commented out. Remove the preceding <code>;<\/code> symbol at the beginning of the line to uncomment them. After that, set the owner and group to <code>nginx<\/code>.<\/p>\n\n\n\n<p>Change the line that contains the listen directive to:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">listen = \/var\/run\/php-fpm\/php-fpm.sock;\nlisten.owner = nginx\nlisten.group = nginx\nlisten.mode = 0660\n<\/pre>\n\n\n\n<p>When you&#8217;re done editing, save and exit the file.<\/p>\n\n\n\n<p>Run the following command to enable and start the <code>php-fpm<\/code> service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo systemctl start php-fpm\n$ sudo systemctl enable php-fpm<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4 \u2013 Setup Nginx to Serve PHP Pages<\/h2>\n\n\n\n<p>We currently have all the&nbsp;necessary components in place. The only thing left to do is instruct Nginx to use our PHP processor for dynamic content.<\/p>\n\n\n\n<p>Nginx provides a dedicated directory where we may configure each hosted website as a distinct configuration file using a server block. This is comparable to Apache&#8217;s virtual hosts.<\/p>\n\n\n\n<p>To proceed, create a new file in the <code>\/etc\/nginx\/conf.d<\/code> directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo nano \/etc\/nginx\/conf.d\/default.conf<\/code><\/pre>\n\n\n\n<p>Copy the PHP server definition block below to your configuration file, and remember to change the server_name directive with your server&#8217;s domain name or IP address:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"nginx\" class=\"language-nginx\">server {\n    listen       80;\n    server_name  server_public_IP;\n\n    root   \/usr\/share\/nginx\/html;\n    index index.php index.html index.htm;\n\n    location \/ {\n        try_files $uri $uri\/ =404;\n    }\n    error_page 404 \/404.html;\n    error_page 500 502 503 504 \/50x.html;\n    \n    location = \/50x.html {\n        root \/usr\/share\/nginx\/html;\n    }\n\n    location ~ \\.php$ {\n        try_files $uri =404;\n        fastcgi_pass unix:\/var\/run\/php-fpm\/php-fpm.sock;\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n}<\/code><\/pre>\n\n\n\n<p>When you&#8217;re done editing, save and exit the file.<\/p>\n\n\n\n<p>Finally, restart Nginx to apply the changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo systemctl restart nginx<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5 \u2013 Run PHP on Nginx.<\/h2>\n\n\n\n<p>We&#8217;ll now create a test PHP page to ensure that the web server functions properly.<br>In the<code> \/usr\/share\/nginx\/html<\/code> directory, create a new PHP file named <code>info.php<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ nano \/usr\/share\/nginx\/html\/info.php<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n\nphpinfo();<\/code><\/pre>\n\n\n\n<p>When you&#8217;re done, save and exit the file.<\/p>\n\n\n\n<p>Now let&#8217;s access the info file in :<\/p>\n\n\n\n<p><code>http:\/\/server_public_IP\/info.php<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"640\" height=\"575\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/php_info.png\" alt=\"Php info file Nginx\" class=\"wp-image-1677\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/php_info.png 640w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/php_info-300x270.png 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/php_info-150x135.png 150w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Introduction &nbsp;&nbsp;&nbsp;LEMP software is a group of open source softwares that is usually installed at the same time to enable a host server&#8217;s dynamic websites and web applications. This term is actually an acronym that represents the Linux operating system, with the ENginx web server. The site data is stored in a MySQL (or MariaDB) ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[69,4],"tags":[],"yoast_head":"\n<title>Installation of Nginx, MySQL, PHP (LEMP) on CentOS 7 - WebHi Tutorials &amp; Documentations<\/title>\n<meta name=\"description\" content=\"This LEMP guide uses PHP 7.4 installed on a CentOS 7 server, using MySQL as the database management system. And nginx as a web server.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installation of Nginx, MySQL, PHP (LEMP) on CentOS 7 - WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"og:description\" content=\"This LEMP guide uses PHP 7.4 installed on a CentOS 7 server, using MySQL as the database management system. And nginx as a web server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhi.technology\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-26T21:56:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-02T10:00:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/lemp_centos_en.jpg\" \/>\n<meta name=\"author\" content=\"webhi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:site\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/\"},\"author\":{\"name\":\"webhi\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\"},\"headline\":\"Installation of Nginx, MySQL, PHP (LEMP) on CentOS 7\",\"datePublished\":\"2022-07-26T21:56:48+00:00\",\"dateModified\":\"2022-09-02T10:00:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/\"},\"wordCount\":883,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"articleSection\":[\"Linux system administration\",\"Web servers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/\",\"name\":\"Installation of Nginx, MySQL, PHP (LEMP) on CentOS 7 - WebHi Tutorials &amp; Documentations\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\"},\"datePublished\":\"2022-07-26T21:56:48+00:00\",\"dateModified\":\"2022-09-02T10:00:56+00:00\",\"description\":\"This LEMP guide uses PHP 7.4 installed on a CentOS 7 server, using MySQL as the database management system. And nginx as a web server.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webhi.com\/how-to\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Installation of Nginx, MySQL, PHP (LEMP) on CentOS 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"name\":\"WebHi Tutorials &amp; Documentations\",\"description\":\"System administration and knowledge base\",\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\",\"name\":\"WebHi Technology\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"width\":288,\"height\":95,\"caption\":\"WebHi Technology\"},\"image\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webhi.technology\",\"https:\/\/twitter.com\/WebHiTechnology\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\",\"name\":\"webhi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1783634435\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1783634435\",\"caption\":\"webhi\"},\"sameAs\":[\"https:\/\/www.webhi.com\/how-to\"],\"url\":\"https:\/\/www.webhi.com\/how-to\/author\/webhi\/\"}]}<\/script>\n","yoast_head_json":{"title":"Installation of Nginx, MySQL, PHP (LEMP) on CentOS 7 - WebHi Tutorials &amp; Documentations","description":"This LEMP guide uses PHP 7.4 installed on a CentOS 7 server, using MySQL as the database management system. And nginx as a web server.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/","og_locale":"en_US","og_type":"article","og_title":"Installation of Nginx, MySQL, PHP (LEMP) on CentOS 7 - WebHi Tutorials &amp; Documentations","og_description":"This LEMP guide uses PHP 7.4 installed on a CentOS 7 server, using MySQL as the database management system. And nginx as a web server.","og_url":"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/","og_site_name":"WebHi Tutorials &amp; Documentations","article_publisher":"https:\/\/www.facebook.com\/webhi.technology","article_published_time":"2022-07-26T21:56:48+00:00","article_modified_time":"2022-09-02T10:00:56+00:00","og_image":[{"url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/lemp_centos_en.jpg"}],"author":"webhi","twitter_card":"summary_large_image","twitter_creator":"@WebHiTechnology","twitter_site":"@WebHiTechnology","twitter_misc":{"Written by":"webhi","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/#article","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/"},"author":{"name":"webhi","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54"},"headline":"Installation of Nginx, MySQL, PHP (LEMP) on CentOS 7","datePublished":"2022-07-26T21:56:48+00:00","dateModified":"2022-09-02T10:00:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/"},"wordCount":883,"commentCount":0,"publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"articleSection":["Linux system administration","Web servers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/","url":"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/","name":"Installation of Nginx, MySQL, PHP (LEMP) on CentOS 7 - WebHi Tutorials &amp; Documentations","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/#website"},"datePublished":"2022-07-26T21:56:48+00:00","dateModified":"2022-09-02T10:00:56+00:00","description":"This LEMP guide uses PHP 7.4 installed on a CentOS 7 server, using MySQL as the database management system. And nginx as a web server.","breadcrumb":{"@id":"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhi.com\/how-to\/installation-of-nginx-mysql-php-lemp-on-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhi.com\/how-to\/"},{"@type":"ListItem","position":2,"name":"Installation of Nginx, MySQL, PHP (LEMP) on CentOS 7"}]},{"@type":"WebSite","@id":"https:\/\/www.webhi.com\/how-to\/#website","url":"https:\/\/www.webhi.com\/how-to\/","name":"WebHi Tutorials &amp; Documentations","description":"System administration and knowledge base","publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhi.com\/how-to\/#organization","name":"WebHi Technology","url":"https:\/\/www.webhi.com\/how-to\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","contentUrl":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","width":288,"height":95,"caption":"WebHi Technology"},"image":{"@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhi.technology","https:\/\/twitter.com\/WebHiTechnology"]},{"@type":"Person","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54","name":"webhi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/","url":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1783634435","contentUrl":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1783634435","caption":"webhi"},"sameAs":["https:\/\/www.webhi.com\/how-to"],"url":"https:\/\/www.webhi.com\/how-to\/author\/webhi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/1609"}],"collection":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/comments?post=1609"}],"version-history":[{"count":76,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/1609\/revisions"}],"predecessor-version":[{"id":2341,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/1609\/revisions\/2341"}],"wp:attachment":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/media?parent=1609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/categories?post=1609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/tags?post=1609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}