{"id":461,"date":"2025-01-10T14:35:20","date_gmt":"2025-01-10T10:35:20","guid":{"rendered":"https:\/\/hostatto.com\/blog\/?p=461"},"modified":"2025-01-18T11:34:23","modified_gmt":"2025-01-18T07:34:23","slug":"install-php-8-3-on-debian-12","status":"publish","type":"post","link":"https:\/\/hostatto.com\/blog\/install-php-8-3-on-debian-12.html","title":{"rendered":"Install PHP 8.3 and PHP-FPM on Debian 12"},"content":{"rendered":"<p>Install PHP 8.3 on Debian 12<\/p>\n<blockquote><p>apt update &amp;&amp; apt install -y wget gnupg2 lsb-release<\/p><\/blockquote>\n<blockquote><p>wget https:\/\/packages.sury.org\/php\/apt.gpg &amp;&amp; apt-key add apt.gpg<\/p><\/blockquote>\n<blockquote><p>echo \"deb https:\/\/packages.sury.org\/php\/ $(lsb_release -sc) main\" | tee \/etc\/apt\/sources.list.d\/php.list<\/p><\/blockquote>\n<blockquote><p>apt install -y php8.3<\/p><\/blockquote>\n<p>After installation check php version<\/p>\n<blockquote><p>php -v<\/p><\/blockquote>\n<h2>Install PHP-FPM and Extensions<\/h2>\n<p>If you also want to install additional modules, then first write the command in the terminal<\/p>\n<blockquote><p>apt-cache search php8.3<\/p><\/blockquote>\n<p>Then select the modules you need and and write in the terminal<\/p>\n<blockquote><p>apt-get install -y php8.3-fpm php8.3-cli php8.3-curl php8.3-mysql php8.3-sqlite3 php8.3-gd php8.3-xml php8.3-mcrypt php8.3-mbstring php8.3-iconv php8.3-cgi php8.3-gd php8.3-zip<\/p><\/blockquote>\n<p>Enable PHP-FPM<\/p>\n<blockquote><p>systemctl enable php8.3-fpm<\/p><\/blockquote>\n<p>Start the PHP-FPM<\/p>\n<blockquote><p>systemctl start php8.3-fpm<\/p><\/blockquote>\n<p>Check PHP-FPM status<\/p>\n<blockquote><p>service php8.3-fpm status<\/p><\/blockquote>\n<p>Result<\/p>\n<blockquote><p>php8.3-fpm.service - The PHP 8.3 FastCGI Process Manager<br \/>\nLoaded: loaded (\/lib\/systemd\/system\/php8.3-fpm.service; enabled; preset: ena&gt;<br \/>\nActive: <strong>active (running)<\/strong> since Sat 2025-01-11 08:35:26 EST; 1min 31s ago<br \/>\nDocs: man:php-fpm8.3(8)<\/p><\/blockquote>\n<h2>Configure PHP-FPM<\/h2>\n<p>Open php.ini file<\/p>\n<blockquote><p>nano \/etc\/php\/8.3\/fpm\/php.ini<\/p><\/blockquote>\n<p>and set<\/p>\n<blockquote><p>cgi.fix_pathinfo=0<\/p><\/blockquote>\n<p>Open PHP-FPM configuration file <strong>www.conf<\/strong><\/p>\n<blockquote><p>nano \/etc\/php\/8.3\/fpm\/pool.d\/www.conf<\/p><\/blockquote>\n<p>And set www-data value for user, group, listen.owner, listen.group<\/p>\n<blockquote><p>user = www-data<br \/>\ngroup = www-data<br \/>\nlisten.owner = www-data<br \/>\nlisten.group = www-data<\/p><\/blockquote>\n<p>Save and restart PHP-FPM<\/p>\n<blockquote><p>service php8.3-fpm restart<\/p><\/blockquote>\n<p>Now open the file <strong>nginx.conf<\/strong><\/p>\n<blockquote><p>nano \/etc\/nginx\/nginx.conf<\/p><\/blockquote>\n<p>And in the first line replace<\/p>\n<blockquote><p>user nginx;<\/p><\/blockquote>\n<p>replace with<\/p>\n<blockquote><p>user www-data;<\/p><\/blockquote>\n<p>Restart the server<\/p>\n<blockquote><p>service nginx restart<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>...<\/p>\n","protected":false},"author":1,"featured_media":206,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[21,19,61],"class_list":["post-461","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-debian","tag-php","tag-php-8-3"],"_links":{"self":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/posts\/461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/comments?post=461"}],"version-history":[{"count":0,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/posts\/461\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/media\/206"}],"wp:attachment":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/media?parent=461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/categories?post=461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/tags?post=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}