{"id":66065,"date":"2020-12-28T10:21:58","date_gmt":"2020-12-28T15:21:58","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/?p=66065"},"modified":"2023-07-17T16:40:06","modified_gmt":"2023-07-17T20:40:06","slug":"how-to-install-php","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/","title":{"rendered":"How to Install PHP on a Linux Cloud Server"},"content":{"rendered":"<p>For some, it is important to know <a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/install-php-8-0\/\">how to install <strong>PHP<\/strong><\/a> as part of the LAMP Stack along with the <strong>Linux<\/strong> operating system family, <strong>Apache<\/strong> web server, and <strong>MySQL<\/strong> database management system. It\u2019s also part of the LEMP Stack which replaces Apache with <strong>NGINX<\/strong>. Many of the most popular content management systems (CMSs) depend on an up-to-date PHP version on your <a href=\"https:\/\/www.inmotionhosting.com\/php-hosting\">PHP hosting server<\/a>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>WordPress<\/li>\n\n\n\n<li>PrestaShop<\/li>\n\n\n\n<li>Nextcloud<\/li>\n\n\n\n<li>Drupal<\/li>\n\n\n\n<li>And many lesser known ones available in Softaculous Instant Installer<\/li>\n<\/ul>\n\n\n\n<p><a href=\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-login-ssh\/\">SSH into your Linux server<\/a>, then read on to learn:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#centos\">How to Install PHP on CentOS 8<\/a><\/li>\n\n\n\n<li><a href=\"#debian\">How to Install PHP on Debian 10<\/a><\/li>\n\n\n\n<li><a href=\"#ubuntu\">How to Install PHP on Ubuntu 18.04<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#nginx\">How to Change your PHP Version<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#nginx\">How to Configure PHP-FPM on NGINX<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"centos\">How to Install PHP on CentOS 8<\/h2>\n\n\n\n<ol class=\"article_list wp-block-list\">\n<li>Enable the<strong> <\/strong>Extra Packages for Enterprise Linux (EPEL) repository. <br>CentOS 7: <pre>sudo dnf install -y https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm<\/pre><br>CentOS 8: <pre>sudo dnf install -y https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-8.noarch.rpm<\/pre><\/li>\n\n\n\n<li>Install the Remi repo for PHP versions:<br>CentOS 7: <pre>sudo dnf install -y https:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm<\/pre><br>CentOS 8: <pre>sudo dnf install -y https:\/\/rpms.remirepo.net\/enterprise\/remi-release-8.rpm<\/pre><\/li>\n\n\n\n<li>View available PHP streams: <pre>sudo dnf module list php<\/pre><\/li>\n\n\n\n<li>Enable the needed PHP module. To enable PHP 8, for example: <pre>sudo dnf module enable php:remi-8.0 -y<\/pre><\/li>\n\n\n\n<li>You can use the following command to search for any other important PHP modules, replacing <em>\u201cpackage\u201d<\/em> with your search query:<pre>sudo dnf search php-package<\/pre><\/li>\n\n\n\n<li>Install any needed packages, again replacing <em>\u201cpackage\u201d<\/em> with the actual package name: <pre>sudo dnf install php-package<\/pre><\/li>\n\n\n\n<li>Run the following command to install PHP on Apache. <pre>sudo dnf install php php-cli php-common<\/pre><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"debian\">How to Install PHP on Debian 10<\/h2>\n\n\n\n<ol class=\"article_list wp-block-list\">\n<li>Update your repos: <pre>sudo apt update<\/pre><\/li>\n\n\n\n<li>Install the required dependencies first: <pre>sudo apt -y install lsb-release apt-transport-https ca-certificates<\/pre><\/li>\n\n\n\n<li>Add the DEB.SURY.ORG GPG key: <pre>sudo wget -O \/etc\/apt\/trusted.gpg.d\/php.gpg https:\/\/packages.sury.org\/php\/apt.gpg<\/pre><\/li>\n\n\n\n<li>Add their repo for PHP on Debian: <pre>echo \"deb https:\/\/packages.sury.org\/php\/ $(lsb_release -sc) main\" | sudo tee \/etc\/apt\/sources.list.d\/sury-php.list<\/pre><\/li>\n\n\n\n<li>Update your repos again: <pre>sudo apt update<\/pre><\/li>\n\n\n\n<li>Install your needed PHP version(s).<br>PHP 7.4: <pre>sudo apt -y install php7.4<\/pre><br>PHP 8.0: <pre>sudo apt install php8.0<\/pre><br>If prompted, press <kbd>Y<\/kbd>, then <kbd>Enter<\/kbd> to confirm the installation.<\/li>\n\n\n\n<li>View your active PHP version: <pre>php -v<\/pre><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ubuntu\">How to Install PHP on Ubuntu 18.04<\/h2>\n\n\n\n<ol class=\"article_list wp-block-list\">\n<li>Update your repos: <pre>sudo apt-get update<\/pre><\/li>\n\n\n\n<li>Ensure the following repo is installed: <pre>sudo apt -y install software-properties-common<\/pre><\/li>\n\n\n\n<li>Add the PHP Personal Package Archive (PPA) by Ondrej: <pre>sudo add-apt-repository ppa:ondrej\/php<\/pre><br>Press <kbd>Enter<\/kbd> to confirm adding the PPA to your system.<\/li>\n\n\n\n<li>Update your repos: <pre>sudo apt-get update<\/pre><\/li>\n\n\n\n<li>Install your needed PHP version(s).<br>PHP 7.4:<pre>sudo apt install -y php7.4<\/pre><br>PHP 7.3: <pre>sudo apt install -y php7.3<\/pre><br>PHP 8.0: <pre>sudo apt install php8.0 libapache2-mod-php8.0<\/pre><\/li>\n\n\n\n<li>(For PHP 8.0) Restart Apache: <pre>sudo systemctl restart apache2<\/pre><\/li>\n\n\n\n<li>View your active PHP version: <pre>php -v<\/pre><\/li>\n\n\n\n<li>You can use the following command to search for any other important PHP modules, replacing <em>\u201c7\u201d<\/em> and <em>\u201cpackage\u201d<\/em> with your search query: <pre>sudo apt-cache search php7.* | grep package<\/pre><\/li>\n\n\n\n<li>Install any needed packages, again replacing <em>\u201c7.4\u201d<\/em> and <em>\u201cpackage\u201d<\/em> with the package name: <pre>sudo apt install php7.4-package<\/pre><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change\">How to Change Your PHP Version<\/h3>\n\n\n\n<ol class=\"article_list wp-block-list\">\n<li>Specify the default PHP version, if you installed more than one PHP version: <pre>sudo update-alternatives --config php<\/pre><\/li>\n\n\n\n<li>Type the selection number on the left that corresponds to your preferred PHP version. Then press <kbd>Enter<\/kbd>.<br><pre>There are 2 choices for the alternative php (providing \/usr\/bin\/php).<br>\u00a0\u00a0Selection\u00a0\u00a0\u00a0 Path \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\u00a0 Priority \u00a0 Status<br>------------------------------------------------------------<br>* 0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\u00a0 \/usr\/bin\/php7.4 \u00a0 74\u00a0 \u00a0 \u00a0\u00a0\u00a0 auto mode<br>\u00a0\u00a01\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\u00a0 \/usr\/bin\/php7.3 \u00a0 73\u00a0 \u00a0 \u00a0\u00a0\u00a0 manual mode<br>\u00a0\u00a02\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\u00a0 \/usr\/bin\/php7.4 \u00a0 74\u00a0 \u00a0 \u00a0\u00a0\u00a0 manual mode<\/pre><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"nginx\">How to Configure PHP-FPM on NGINX<\/h2>\n\n\n\n<p>The steps below cover how to install <strong>PHP-FastCGI Process Manager (PHP-FPM)<\/strong> alongside the NGINX reverse proxy server.<\/p>\n\n\n\n<p class=\"alert alert-info\">Running Ansible for IT automation? Configure PHP-FPM and NGINX on your remote systems quickly with our <a aria-label=\" (opens in a new tab)\" href=\"https:\/\/galaxy.ansible.com\/inmotionhosting\" target=\"_blank\" rel=\"noreferrer noopener\">Ansible roles<\/a>.<\/p>\n\n\n\n<ol class=\"article_list wp-block-list\">\n<li>Stop the Apache service: <pre>sudo systemctl disable --now apache2<\/pre><\/li>\n\n\n\n<li>Install PHP-FPM for your OS and PHP version(s).<br><br>CentOS: <pre>sudo dnf install php php-cli php-common php-fpm<\/pre><br>Debian\/Ubuntu (replace the version if necessary): <pre>sudo apt-get install php8.0-fpm<\/pre><\/li>\n\n\n\n<li>If you receive any notices to enable important modules after the installation completes, run the commands as necessary.<\/li>\n\n\n\n<li>You can make changes in the PHP-FPM configuration file using your preferred text editor \u2013 nano, Emacs, vim, etc. CentOS: <pre>nano \/etc\/php-fpm.d\/www.conf<\/pre><br>Debian\/Ubuntu: <pre>nano \/etc\/php\/7.4\/fpm\/pool.d\/www.conf<\/pre><\/li>\n<\/ol>\n\n\n\n<p>To see all of your PHP settings easily after you learn how to install PHP, <a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-create-a-phpinfo-page\/\">create a phpinfo.php file<\/a>. This could help you troubleshoot PHP related issues from your web browser.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74-1024x576.png\" alt=\"Create a PHPinfo.php file after learning how to install PHP\" class=\"wp-image-66068\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74-1024x576.png 1024w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74-300x169.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74-768x432.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74-1536x864.png 1536w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74.png 1920w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Learn how to get the most out of your <a href=\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/\">Linux Cloud Server Hosting<\/a>.<\/p>\n\n\n<div class=\"jumbotron\">\r\n<p>If you don\u2019t need cPanel, don't pay for it. Only pay for what you need with our scalable <a href=\"https:\/\/www.inmotionhosting.com\/cloud-vps\">Cloud VPS Hosting<\/a>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>CentOS, Debian, or Ubuntu    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>No Bloatware    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>SSH and Root Access<\/p>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>For some, it is important to know how to install PHP as part of the LAMP Stack along with the Linux operating system family, Apache web server, and MySQL database management system. It\u2019s also part of the LEMP Stack which replaces Apache with NGINX. Many of the most popular content management systems (CMSs) depend on<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/\"> Read More ><\/a><\/p>\n","protected":false},"author":57014,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4370],"tags":[],"class_list":["post-66065","post","type-post","status-publish","format-standard","hentry","category-cloud-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install PHP on a Linux Cloud Server | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Learn how to install PHP on your Linux cloud server, change your PHP version, and install PHP-FPM for use with NGINX.\" \/>\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.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install PHP on a Linux Cloud Server | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn how to install PHP on your Linux cloud server, change your PHP version, and install PHP-FPM for use with NGINX.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-28T15:21:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-17T20:40:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/canva-how-to-install-php.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\"},\"headline\":\"How to Install PHP on a Linux Cloud Server\",\"datePublished\":\"2020-12-28T15:21:58+00:00\",\"dateModified\":\"2023-07-17T20:40:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/\"},\"wordCount\":538,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74-1024x576.png\",\"articleSection\":[\"Cloud Server Hosting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/\",\"name\":\"How to Install PHP on a Linux Cloud Server | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74-1024x576.png\",\"datePublished\":\"2020-12-28T15:21:58+00:00\",\"dateModified\":\"2023-07-17T20:40:06+00:00\",\"description\":\"Learn how to install PHP on your Linux cloud server, change your PHP version, and install PHP-FPM for use with NGINX.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#primaryimage\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74.png\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74.png\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install PHP on a Linux Cloud Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install PHP on a Linux Cloud Server | InMotion Hosting","description":"Learn how to install PHP on your Linux cloud server, change your PHP version, and install PHP-FPM for use with NGINX.","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.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/","og_locale":"en_US","og_type":"article","og_title":"How to Install PHP on a Linux Cloud Server | InMotion Hosting","og_description":"Learn how to install PHP on your Linux cloud server, change your PHP version, and install PHP-FPM for use with NGINX.","og_url":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2020-12-28T15:21:58+00:00","article_modified_time":"2023-07-17T20:40:06+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/canva-how-to-install-php.png","type":"image\/png"}],"author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644"},"headline":"How to Install PHP on a Linux Cloud Server","datePublished":"2020-12-28T15:21:58+00:00","dateModified":"2023-07-17T20:40:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/"},"wordCount":538,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74-1024x576.png","articleSection":["Cloud Server Hosting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/","url":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/","name":"How to Install PHP on a Linux Cloud Server | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#primaryimage"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74-1024x576.png","datePublished":"2020-12-28T15:21:58+00:00","dateModified":"2023-07-17T20:40:06+00:00","description":"Learn how to install PHP on your Linux cloud server, change your PHP version, and install PHP-FPM for use with NGINX.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#primaryimage","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74.png","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/12\/phpinfo-74.png","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/how-to-install-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Install PHP on a Linux Cloud Server"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4370,"name":"Cloud Server Hosting","slug":"cloud-server","link":"https:\/\/www.inmotionhosting.com\/support\/product-guides\/cloud-server\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/66065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/57014"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=66065"}],"version-history":[{"count":12,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/66065\/revisions"}],"predecessor-version":[{"id":105700,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/66065\/revisions\/105700"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=66065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=66065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=66065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}