{"id":3028,"date":"2021-06-25T20:10:15","date_gmt":"2021-06-25T16:40:15","guid":{"rendered":"https:\/\/fireserver.ir\/blog\/?p=3028"},"modified":"2021-06-29T23:45:26","modified_gmt":"2021-06-29T20:15:26","slug":"how-to-install-php-8-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/fireserver.ir\/blog\/how-to-install-php-8-on-ubuntu-20-04\/","title":{"rendered":"\u0622\u0645\u0648\u0632\u0634 \u0646\u0635\u0628 PHP 8 \u062f\u0631 Ubuntu 20.04"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]PHP \u06cc\u06a9\u06cc \u0627\u0632 \u06af\u0633\u062a\u0631\u062f\u0647 \u062a\u0631\u06cc\u0646 \u0632\u0628\u0627\u0646 \u0647\u0627\u06cc \u0645\u0648\u0631\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u062f\u0631 \u0633\u0645\u062a \u0633\u0631\u0648\u0631 \u0627\u0633\u062a\u060c \u062e\u06cc\u0644\u06cc \u0627\u0632 CMS \u0647\u0627 (\u0633\u06cc\u0633\u062a\u0645 \u0647\u0627\u06cc \u0645\u062f\u06cc\u0631\u06cc\u062a \u0645\u062d\u062a\u0648\u0627) \u0648 \u062e\u06cc\u0644\u06cc Framework \u0647\u0627\u06cc \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0645\u0627\u0646\u0646\u062f WordPress, Magento, \u0648 Laravel \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0632\u0628\u0627\u0646 PHP \u0645\u062a\u0648\u0644\u062f \u0634\u062f\u0647 \u0627\u0646\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u062a\u0627\u0631\u06cc\u062e <a href=\"https:\/\/www.php.net\/releases\/8.0\/en.php\" target=\"_blank\" rel=\"noopener\">PHP 8.0<\/a> \u0646\u0633\u062e\u0647 \u0622\u062e\u0631 \u0632\u0628\u0627\u0646 PHP \u0627\u0633\u062a\u060c (**\u0628\u0628\u062e\u0634\u06cc\u062f \u06a9\u0647 \u062a\u0631\u062c\u0645\u0647 \u0647\u0645\u0647 \u0686\u06cc\u0632 \u0628\u0647 \u062e\u0648\u0628\u06cc \u062f\u0631 \u0646\u0645\u06cc\u0627\u062f \u0648 \u0645\u062c\u0628\u0648\u0631\u06cc\u0645 \u0628\u0639\u0636\u06cc \u0686\u06cc\u0632 \u0647\u0627\u0631\u0648 \u0628\u062f\u0648\u0646 \u062a\u0631\u062c\u0645\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u0645.**) \u0627\u0632 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a \u0645\u0647\u0645 \u0648 \u0648\u06cc\u0698\u06af\u06cc \u0647\u0627\u06cc \u0627\u06cc\u0646 \u0646\u0633\u062e\u0647 \u0645\u06cc \u062a\u0648\u0627\u0646 \u0645\u0648\u0627\u0631\u062f \u0632\u06cc\u0644 \u0631\u0627 \u0646\u0627\u0645 \u0628\u0631\u062f\u060c named arguments, JIT compiler, union types, match expression.<\/p>\n<p>\u062f\u0631 \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0646\u0648\u0634\u062a\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a Repository \u0647\u0627\u06cc \u067e\u06cc\u0634 \u0641\u0631\u0636 \u062f\u0631 Ubuntu 20.04 \u062f\u0627\u0631\u0627\u06cc PHP \u0646\u0633\u062e\u0647 7.4 \u0647\u0633\u062a\u0646\u062f \u06a9\u0647 \u0645\u0627 \u0628\u0631\u0627\u06cc \u0646\u0635\u0628 PHP 8.0 \u0628\u0627\u06cc\u062f Repository \u0647\u0627\u06cc ondrej\/php PPA \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u0645\u060c \u0642\u0628\u0644 \u0627\u0632 \u0647\u0631 \u0627\u0642\u062f\u0627\u0645\u06cc \u0628\u0627\u06cc\u062f \u0645\u0637\u0645\u0639\u0646 \u0634\u0648\u06cc\u062f \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631 \u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0631\u0648\u06cc \u0633\u06cc\u0633\u062a\u0645 \u0634\u0645\u0627 \u0628\u0627 \u0646\u0633\u062e\u0647 \u0647\u0627\u06cc \u0642\u0628\u0644\u06cc PHP \u062f\u0631 \u062d\u0627\u0644 \u0627\u062c\u0631\u0627 \u0647\u0633\u062a\u0646\u062f \u0628\u0627 \u0646\u0633\u062e\u0647 \u062c\u062f\u06cc\u062f \u0646\u06cc\u0632 \u0642\u0627\u0628\u0644 \u0627\u062c\u0631\u0627 \u0628\u0627\u0634\u0646\u062f \u062f\u0631 \u063a\u06cc\u0631 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u0628\u0627 \u0645\u0634\u06a9\u0644 \u0645\u0648\u0627\u062c\u0647 \u062e\u0648\u0627\u0647\u06cc\u062f \u0634\u062f. \u0647\u0645\u0686\u0646\u06cc\u0646 \u062f\u0631 \u0646\u0638\u0631 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u0645\u0631\u0627\u062d\u0644 \u0646\u0635\u0628 \u062f\u0631 \u062a\u0648\u0632\u06cc\u0639 \u0647\u0627\u06cc Ubuntu 18.04 and all Ubuntu-based distribution, including Kubuntu, Linux Mint, and Elementary OS \u0645\u0634\u0627\u0628\u0647 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0645\u06cc \u0628\u0627\u0634\u062f.<\/p>\n<h2>\u0622\u0645\u0648\u0632\u0634 \u0646\u0635\u0628 PHP 8 \u062f\u0631 Ubuntu 20.04<\/h2>\n<h3>\u0641\u0639\u0627\u0644 \u0633\u0627\u0632\u06cc PHP Repository<\/h3>\n<p><code style=\"direction: ltr;\">sudo apt install software-properties-common<br \/>\nsudo add-apt-repository ppa:ondrej\/php<\/code><\/p>\n<h3>\u0646\u0635\u0628 PHP 8 \u062f\u0631 Apache<\/h3>\n<p>\u0627\u06af\u0631 \u0634\u0645\u0627 \u0627\u0632 \u0648\u0628 \u0633\u0631\u0648\u0631 Apache \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u062f \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f PHP \u0631\u0627 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0627\u0641\u0632\u0648\u0646\u0647 \u0627\u06cc \u0628\u0631\u0627\u06cc Apache \u06cc\u0627 PHP-FPM \u0646\u0635\u0628 \u0646\u0645\u0627\u06cc\u06cc\u062f.<\/p>\n<h3>\u0646\u0635\u0628 PHP 8 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0627\u0641\u0632\u0648\u0646\u0647 Apache<\/h3>\n<p>\u062c\u0647\u062a \u0646\u0635\u0628 php \u0631\u0648\u06cc \u0648\u0628\u0633\u0631\u0648\u0631 Apache \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u0646\u0645\u0627\u06cc\u06cc\u062f:<\/p>\n<p><code style=\"direction: ltr;\">sudo apt update<br \/>\nsudo apt install php8.0 libapache2-mod-php8.0<\/code><\/p>\n<p>\u062e\u0648\u0628 \u062d\u0627\u0644\u0627 \u067e\u06a9\u06cc\u062c \u0647\u0627\u0645\u0648\u0646 \u0646\u0635\u0628 \u0634\u062f\u0646 \u0648 \u0628\u0627\u06cc\u062f \u0633\u0631\u0648\u06cc\u0633 Apache \u0631\u0648 \u0631\u06cc\u0633\u062a\u0627\u0631\u062a \u06a9\u0646\u06cc\u062f \u062a\u0627 PHP \u0644\u0648\u062f \u0634\u0648\u062f.<\/p>\n<p><code style=\"direction: ltr;\">sudo systemctl restart apache2<\/code><\/p>\n<p><strong>\u0646\u0635\u0628 Apache \u0628\u0627 PHP-FPM<\/strong><\/p>\n<p>PHP-FPM \u0645\u062e\u0641\u0641 FastCGI Process Manager \u0648 \u062c\u0627\u06cc\u06af\u0632\u06cc\u0646 PHP FastCGI \u0645\u06cc \u0628\u0627\u0634\u062f \u06a9\u0647 \u0627\u0645\u06a9\u0627\u0646\u0627\u062a \u0641\u0631\u0627\u0648\u0627\u0646 \u06a9\u0627\u0631\u0628\u0631\u062f\u06cc \u0628\u0631\u0627\u06cc \u0648\u0628 \u0633\u0627\u06cc\u062a \u0647\u0627 \u0628\u0627 \u0647\u0631 \u0627\u0646\u062f\u0627\u0632\u0647 \u0627\u06cc \u0648 \u062a\u0631\u0627\u0641\u06cc\u06a9\u06cc \u0628\u0647 \u062e\u0635\u0648\u0635 \u0633\u0627\u06cc\u062a \u0647\u0627\u06cc\u06cc \u0628\u0627 \u062a\u0631\u0627\u0641\u06cc\u06a9 \u0628\u0627\u0644\u0627 \u0645\u0646\u0627\u0633\u0628 \u0645\u06cc \u0628\u0627\u0634\u062f. \u0628\u0631\u0627\u06cc \u0646\u0635\u0628 \u0622\u0646 \u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0632\u06cc\u0631 \u0631\u0627 \u0627\u062c\u0631\u0627 \u0646\u0645\u0627\u06cc\u06cc\u062f:<\/p>\n<p><code style=\"direction: ltr;\">sudo apt update<br \/>\nsudo apt install php8.0-fpm libapache2-mod-fcgid<\/code><\/p>\n<p>\u0628\u0647 \u0637\u0648\u0631 \u067e\u06cc\u0634 \u0641\u0631\u0636 PHP-FPM \u063a\u06cc\u0631 \u0641\u0639\u0627\u0644 \u0627\u0633\u062a \u0648 \u0628\u0631\u0627\u06cc \u0641\u0639\u0627\u0644 \u06a9\u0631\u062f\u0646 \u0622\u0646 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u0627\u062c\u0631\u0627 \u0646\u0645\u0627\u06cc\u06cc\u062f:<\/p>\n<p><code style=\"direction: ltr;\">sudo a2enmod proxy_fcgi setenvif<br \/>\nsudo a2enconf php8.0-fpm<br \/>\n<\/code><\/p>\n<p>\u0628\u0631\u0627\u06cc \u0641\u0639\u0627\u0644\u0633\u0627\u0632\u06cc \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a \u0633\u0631\u0648\u06cc\u0633 Apache \u0631\u0627 \u0627\u0632 \u0637\u0631\u06cc\u0642 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u06cc\u0633\u062a\u0627\u0631\u062a \u0646\u0645\u0627\u06cc\u06cc\u062f:<\/p>\n<p><code style=\"direction: ltr;\">systemctl restart apache2<\/code><\/p>\n<blockquote><p>\u0627\u06af\u0631 \u0646\u06cc\u0627\u0632\u0645\u0646\u062f \u0633\u0631\u0648\u0631 \u0645\u062c\u0627\u0632\u06cc \u0627\u06cc\u0631\u0627\u0646 \u0647\u0633\u062a\u06cc\u062f \u0641\u0627\u06cc\u0631 \u0633\u0631\u0648\u0631 \u0627\u0631\u0627\u0626\u0647 \u062f\u0647\u0646\u062f\u0647 \u0628\u0647\u062a\u0631\u06cc\u0646 \u0633\u0631\u0648\u06cc\u0633 <a href=\"https:\/\/fireserver.ir\/vps\/iran\">\u0633\u0631\u0648\u0631 \u0645\u062c\u0627\u0632\u06cc \u0627\u06cc\u0631\u0627\u0646<\/a> \u0627\u0632 \u062f\u06cc\u062a\u0627\u0633\u0646\u062a\u0631 \u0622\u0633\u06cc\u0627\u062a\u06a9 \u0628\u0631\u062c \u0645\u06cc\u0644\u0627\u062f\u00a0 \u0627\u0633\u062a.<\/p><\/blockquote>\n<p>[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row][vc_column][vc_column_text]PHP \u06cc\u06a9\u06cc \u0627\u0632 \u06af\u0633\u062a\u0631\u062f\u0647 \u062a\u0631\u06cc\u0646 \u0632\u0628\u0627\u0646 \u0647\u0627\u06cc \u0645\u0648\u0631\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u062f\u0631 \u0633\u0645\u062a \u0633\u0631\u0648\u0631 \u0627\u0633\u062a\u060c \u062e\u06cc\u0644\u06cc \u0627\u0632 CMS \u0647\u0627 (\u0633\u06cc\u0633\u062a\u0645 \u0647\u0627\u06cc \u0645\u062f\u06cc\u0631\u06cc\u062a \u0645\u062d\u062a\u0648\u0627) \u0648 \u062e\u06cc\u0644\u06cc Framework \u0647\u0627\u06cc \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0645\u0627\u0646\u0646\u062f WordPress, Magento, \u0648 Laravel \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0632\u0628\u0627\u0646 PHP \u0645\u062a\u0648\u0644\u062f \u0634\u062f\u0647 \u0627\u0646\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u062a\u0627\u0631\u06cc\u062e PHP 8.0 \u0646\u0633\u062e\u0647 \u0622\u062e\u0631 \u0632\u0628\u0627\u0646 PHP \u0627\u0633\u062a\u060c (**\u0628\u0628\u062e\u0634\u06cc\u062f \u06a9\u0647 \u062a\u0631\u062c\u0645\u0647 \u0647\u0645\u0647 \u0686\u06cc\u0632 &hellip;<\/p>\n","protected":false},"author":7,"featured_media":3056,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[143,1],"tags":[],"class_list":["post-3028","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-tutorials"],"_links":{"self":[{"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/posts\/3028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/comments?post=3028"}],"version-history":[{"count":8,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/posts\/3028\/revisions"}],"predecessor-version":[{"id":3060,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/posts\/3028\/revisions\/3060"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/media\/3056"}],"wp:attachment":[{"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/media?parent=3028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/categories?post=3028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/tags?post=3028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}