{"id":11049,"date":"2022-05-11T03:52:48","date_gmt":"2022-05-11T03:52:48","guid":{"rendered":"https:\/\/green.cloud\/docs\/docly-documentation\/content\/how-to-instructions-for-installing-php-8-1-on-centos7\/"},"modified":"2026-01-19T00:45:46","modified_gmt":"2026-01-19T00:45:46","slug":"how-to-instructions-for-installing-php-8-1-on-centos7","status":"publish","type":"docs","link":"https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/","title":{"rendered":"How to install PHP 8.1 on CentOS 9 Stream"},"content":{"rendered":"<h2><strong>Introduce<\/strong><\/h2>\n<h3><strong>What is PHP?<\/strong><\/h3>\n<p>PHP 8.1 is the current latest stable release of the PHP scripting language Hypertext Preprocessor. It has been available in almost all web hosting provider to support their clients in managing or hosting their websites or blogs. PHP-FPM (FastCGI Process Manager) is a PHP FastCGI implementation which mostly used for heavy-loaded production environments.<\/p>\n<p>PHP-FPM is commonly used with a Nginx web server in some production server environments, where the system usually works under high load. But, in another way, it is also often used with Nginx Reverse Proxy in the front of the Apache web server as its backend with MultiPHP-FPM Support.<\/p>\n<h3><strong>What&#8217;s New in PHP 8.1?<\/strong><\/h3>\n<ul>\n<li><strong>Enums have been integrated<\/strong><\/li>\n<li><strong>Read-only properties<\/strong> (Class properties can be marked as read-only and thus can only be written once.<\/li>\n<li><strong>Never\u00a0<\/strong><strong>keyword<\/strong>\u00a0(A new return type hint named Never was added in PHP 8.1)<\/li>\n<li><strong>DNS over HTTPS (DoH) support<\/strong>.<\/li>\n<li><strong>Support AVIF Image format<\/strong>.<\/li>\n<li><strong>Added support for Fibers<\/strong> (Low-level mechanism for parallel management).<\/li>\n<li><strong>The PHP Curl extension now supports HTTP(S) requests with File upload.<\/strong><\/li>\n<li><strong>Support for new fdatasync() and fsync() functions.\u00a0<\/strong><\/li>\n<li><strong>PHP 8.1 adds array_is_list as a built-in function<\/strong>.<\/li>\n<li><strong>Speed \u200b\u200befficiency improved\u00a0<\/strong>\u00a0<strong>from 5% to 8%\u00a0<\/strong><strong>compared to the old version<\/strong><\/li>\n<li><strong>Unpack the array using string keys<\/strong>.<\/li>\n<\/ul>\n<h2>Install PHP 8.1 on CentOS 9<\/h2>\n<p><iframe title=\"How to install PHP 8.1 on CentOS 9 | VPS Tutorial\" width=\"1170\" height=\"658\" src=\"https:\/\/www.youtube.com\/embed\/bWlp6hJbJEw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe><\/p>\n<p>Since the default YUM repository in CentOS 9 does not have PHP 8.1 packages available, we will use the REMI repository to install 8.1 on CentOS 9<\/p>\n<h3><strong>Step 1: SSH into the server<\/strong><\/h3>\n<p>To install PHP 8.1 on CentOS 9, the first thing we need to do is SSH or access your VPS or server with root privileges.<\/p>\n<p>After successfully SSH, we continue with step 2.<\/p>\n<h3><strong>Step 2: Install PHP 8.1 on CentOS 9<\/strong><\/h3>\n<p>To get started, you need to add the Remi repository first so that from there you will be able to install PHP 8.1 on CentOS 9.<\/p>\n<p>To install and activate the Remi repository on CentOS 9, you need to run the following commands:<\/p>\n<div class=\"terminal shadow\">\n<pre class=\"body\">yum install epel-release &amp;&amp; yum install remi-release<\/pre>\n<pre class=\"body\">dnf install https:\/\/rpms.remirepo.net\/enterprise\/remi-release-9.rpm<\/pre>\n<\/div>\n<p>Below is the output after running the above commands.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" class=\"wp-image-14757\" src=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2022\/05\/Screenshot_1-11.png\" alt=\"Instructions for installing PHP 8.1 on CentOS7\" \/><\/figure>\n<\/div>\n<ul>\n<li>Next, you can make a list of available PHP versions using DNF module commands. Simply run the following command to list all available PHP versions in your CentOS 9 Stream.<\/li>\n<\/ul>\n<div class=\"terminal shadow\">\n<pre>dnf module list php\r\ndnf module <span class=\"token builtin class-name\">enable<\/span> php:remi-8.1 -y<\/pre>\n<p>In the next step simply run the following command to install PHP 8.1 with FastCGI Process Manager (PHP-FPM) sometimes called a PHP81-FPM.<\/p>\n<pre>dnf install php-fpm php php-bcmath php-cli php-common php-gd php-imap php-mbstring php-mcrypt php-mysql php-mysqlnd php-pdo php-soap php-tidy php-xml php-xmlrpc php-opcache php-redis php-pecl-mcrypt php-brotli<\/pre>\n<\/div>\n<p>Below is the output after running the above commands<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" class=\"wp-image-14758\" src=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2022\/05\/Screenshot_2-11.png\" alt=\"Instructions for installing PHP 8.1 on CentOS7\" \/><\/figure>\n<\/div>\n<p>You can utilize the following available commands to manage your PHP-FPM in your CentOS 9 machine.<\/p>\n<pre>systemctl status php-fpm<\/pre>\n<p><strong>Enable PHP-FPM to start automatically from boot<\/strong><\/p>\n<pre>systemctl enable php-fpm<\/pre>\n<p><strong>To Start PHP-FPM<\/strong><\/p>\n<pre>$ systemctl start php-fpm<\/pre>\n<p><strong>To Stop PHP-FPM<\/strong><\/p>\n<pre>$ systemctl stop php-fpm<\/pre>\n<p><strong>To Restart PHP-FPM<\/strong><\/p>\n<pre>$ systemctl restart php-fpm<\/pre>\n<div class=\"code-block code-block-2\">\n<div id=\"aswift_8_host\" tabindex=\"0\" title=\"Advertisement\" aria-label=\"Advertisement\"><strong>To<\/strong><strong> Check<\/strong><strong> the PH<\/strong><strong>P-FPM<\/strong><strong> Service<\/strong><strong> State<\/strong><\/div>\n<\/div>\n<pre>$ systemctl status php-fpm<\/pre>\n<h3><strong>Step 3: Check the PHP version after installation<\/strong><\/h3>\n<p>After you have installed it, you can check the PHP version again with the following command:<\/p>\n<div class=\"terminal shadow\">\n<pre class=\"body\">php -v\r\n<\/pre>\n<\/div>\n<p>Below is the output after running the above command<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" class=\"wp-image-14759\" src=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2022\/05\/Screenshot_3-2.png\" alt=\"Instructions for installing PHP 8.1 on CentOS7\" \/><\/figure>\n<\/div>\n<p>As shown, I have successfully installed PHP 8.1 on CentOS 9.<\/p>\n<h2>Summary<\/h2>\n<p>So in this article, I showed you how to install PHP 8.1 on a CentOS 9 stream in a very simple and fast way. PHP 8.1 will certainly bring many new utilities, thus helping applications or websites to operate with maximum efficiency and stability. Hope the article will help you and wish you success.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduce What is PHP? PHP 8.1 is the current latest stable release of the PHP scripting language Hypertext Preprocessor. It has been available in almost all web hosting provider to support their clients in managing or hosting their websites or blogs. PHP-FPM (FastCGI Process Manager) is a PHP FastCGI implementation which mostly used for heavy-loaded [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":0,"parent":17817,"menu_order":471,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-11049","docs","type-docs","status-publish","hentry","no-post-thumbnail"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to install PHP 8.1 on CentOS 9 Stream - GreenCloud Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/\" \/>\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 8.1 on CentOS 9 Stream - GreenCloud Documentation\" \/>\n<meta property=\"og:description\" content=\"Introduce What is PHP? PHP 8.1 is the current latest stable release of the PHP scripting language Hypertext Preprocessor. It has been available in almost all web hosting provider to support their clients in managing or hosting their websites or blogs. PHP-FPM (FastCGI Process Manager) is a PHP FastCGI implementation which mostly used for heavy-loaded [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/\" \/>\n<meta property=\"og:site_name\" content=\"GreenCloud Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-19T00:45:46+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\\\/\",\"url\":\"https:\\\/\\\/green.cloud\\\/docs\\\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\\\/\",\"name\":\"How to install PHP 8.1 on CentOS 9 Stream - GreenCloud Documentation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/green.cloud\\\/docs\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/Screenshot_1-11.png\",\"datePublished\":\"2022-05-11T03:52:48+00:00\",\"dateModified\":\"2026-01-19T00:45:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/green.cloud\\\/docs\\\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\\\/#primaryimage\",\"url\":\"https:\\\/\\\/green.cloud\\\/docs\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/Screenshot_1-11.png\",\"contentUrl\":\"https:\\\/\\\/green.cloud\\\/docs\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/Screenshot_1-11.png\",\"width\":784,\"height\":381},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/green.cloud\\\/docs\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GreenCloud Documents\",\"item\":\"https:\\\/\\\/green.cloud\\\/docs\\\/docs\\\/greencloud-documents\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Linux Operating Systems\",\"item\":\"https:\\\/\\\/green.cloud\\\/docs\\\/linux-operating-systems\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How to install PHP 8.1 on CentOS 9 Stream\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/#website\",\"url\":\"https:\\\/\\\/green.cloud\\\/docs\\\/\",\"name\":\"GreenCloud Documentation\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/green.cloud\\\/docs\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install PHP 8.1 on CentOS 9 Stream - GreenCloud Documentation","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:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/","og_locale":"en_US","og_type":"article","og_title":"How to install PHP 8.1 on CentOS 9 Stream - GreenCloud Documentation","og_description":"Introduce What is PHP? PHP 8.1 is the current latest stable release of the PHP scripting language Hypertext Preprocessor. It has been available in almost all web hosting provider to support their clients in managing or hosting their websites or blogs. PHP-FPM (FastCGI Process Manager) is a PHP FastCGI implementation which mostly used for heavy-loaded [&hellip;]","og_url":"https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/","og_site_name":"GreenCloud Documentation","article_modified_time":"2026-01-19T00:45:46+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/","url":"https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/","name":"How to install PHP 8.1 on CentOS 9 Stream - GreenCloud Documentation","isPartOf":{"@id":"https:\/\/green.cloud\/docs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/#primaryimage"},"image":{"@id":"https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/#primaryimage"},"thumbnailUrl":"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2022\/05\/Screenshot_1-11.png","datePublished":"2022-05-11T03:52:48+00:00","dateModified":"2026-01-19T00:45:46+00:00","breadcrumb":{"@id":"https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/#primaryimage","url":"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2022\/05\/Screenshot_1-11.png","contentUrl":"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2022\/05\/Screenshot_1-11.png","width":784,"height":381},{"@type":"BreadcrumbList","@id":"https:\/\/green.cloud\/docs\/how-to-instructions-for-installing-php-8-1-on-centos9-stream\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/green.cloud\/docs\/"},{"@type":"ListItem","position":2,"name":"GreenCloud Documents","item":"https:\/\/green.cloud\/docs\/docs\/greencloud-documents\/"},{"@type":"ListItem","position":3,"name":"Linux Operating Systems","item":"https:\/\/green.cloud\/docs\/linux-operating-systems\/"},{"@type":"ListItem","position":4,"name":"How to install PHP 8.1 on CentOS 9 Stream"}]},{"@type":"WebSite","@id":"https:\/\/green.cloud\/docs\/#website","url":"https:\/\/green.cloud\/docs\/","name":"GreenCloud Documentation","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/green.cloud\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/11049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/comments?post=11049"}],"version-history":[{"count":11,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/11049\/revisions"}],"predecessor-version":[{"id":23761,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/11049\/revisions\/23761"}],"up":[{"embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/17817"}],"wp:attachment":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/media?parent=11049"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/doc_tag?post=11049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}