{"id":14265,"date":"2026-08-05T07:59:44","date_gmt":"2026-08-05T07:59:44","guid":{"rendered":"https:\/\/myprojects.advchaweb.com\/?p=14265"},"modified":"2026-08-05T08:27:53","modified_gmt":"2026-08-05T08:27:53","slug":"install-php-8-4-on-ubuntu-24-04-apache","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2026\/08\/05\/install-php-8-4-on-ubuntu-24-04-apache\/","title":{"rendered":"Install PHP 8.4 On Ubuntu 24.04 (Apache)"},"content":{"rendered":"<p>I already added Ond\u0159ej Sur\u00fd PPA repository. So Just install php8.4<\/p>\n<pre class=\"lang:default decode:true\">~$ sudo apt-get install libapache2-mod-php8.4<\/pre>\n<p>The apache module and cli for php8.4 is included<\/p>\n<pre class=\"lang:default decode:true\">...\r\nhe following additional packages will be installed:\r\n  php8.4-cli php8.4-common php8.4-opcache php8.4-readline php8.4-soap\r\nThe following NEW packages will be installed:\r\n  libapache2-mod-php8.4\r\nThe following packages will be upgraded:\r\n  php8.4-cli php8.4-common php8.4-opcache php8.4-readline php8.4-soap\r\n...<\/pre>\n<p>Check it on CLI Terminal<\/p>\n<pre class=\"lang:default decode:true\">~$ sudo update-alternatives --config php\r\nThere are 8 choices for the alternative php (providing \/usr\/bin\/php).\r\n\r\n  Selection    Path             Priority   Status\r\n------------------------------------------------------------\r\n  0            \/usr\/bin\/php8.4   84        auto mode\r\n  1            \/usr\/bin\/php5.6   56        manual mode\r\n  2            \/usr\/bin\/php7.2   72        manual mode\r\n  3            \/usr\/bin\/php7.4   74        manual mode\r\n  4            \/usr\/bin\/php8.0   80        manual mode\r\n  5            \/usr\/bin\/php8.1   81        manual mode\r\n* 6            \/usr\/bin\/php8.2   82        manual mode\r\n  7            \/usr\/bin\/php8.3   83        manual mode\r\n  8            \/usr\/bin\/php8.4   84        manual mode\r\n\r\nPress &lt;enter&gt; to keep the current choice[*], or type selection number: 8\r\nupdate-alternatives: using \/usr\/bin\/php8.4 to provide \/usr\/bin\/php (php) in manual mode\r\n\r\n~$ php -v\r\nPHP 8.4.24 (cli) (built: Jul 30 2026 15:23:13) (NTS)\r\nCopyright (c) The PHP Group\r\nBuilt by Ubuntu\r\nZend Engine v4.4.24, Copyright (c) Zend Technologies\r\n    with Zend OPcache v8.4.24, Copyright (c), by Zend Technologies<\/pre>\n<p>Then install the extensions.<\/p>\n<pre class=\"lang:default decode:true\">sudo apt install php8.4-{bcmath,xml,fpm,mysql,zip,intl,ldap,gd,bz2,curl,mbstring,pgsql,cgi}<\/pre>\n<p>Install XDebug<\/p>\n<pre class=\"lang:default decode:true\">sudo apt-get install php8.4-xdebug<\/pre>\n<p>Check<\/p>\n<pre class=\"lang:default decode:true\">~$ php -v\r\nPHP 8.4.24 (cli) (built: Jul 30 2026 15:23:13) (NTS)\r\nCopyright (c) The PHP Group\r\nBuilt by Ubuntu\r\nZend Engine v4.4.24, Copyright (c) Zend Technologies\r\n    with Zend OPcache v8.4.24, Copyright (c), by Zend Technologies\r\n    with Xdebug v3.5.3, Copyright (c) 2002-2026, by Derick Rethans<\/pre>\n<p>PHP8.4 On Apache2<br \/>\nDisable the old PHP<\/p>\n<pre class=\"lang:default decode:true\">sudo a2dismod php8.2<\/pre>\n<p>Enable PHP8.4<\/p>\n<pre class=\"lang:default decode:true\">sudo a2enmod php8.4<\/pre>\n<p>Also need to run<\/p>\n<pre class=\"lang:default decode:true\">sudo a2enmod proxy_fcgi setenvif &amp;&amp; sudo a2enconf php8.4-fpm<\/pre>\n<p>Restart Apache server<\/p>\n<pre class=\"lang:default decode:true \">sudo systemctl restart apache2<\/pre>\n<p>Check on the browser<\/p>\n<pre class=\"lang:default decode:true \">http:\/\/localhost\/phpinfo.php<\/pre>\n<p>Should show like PHP Version 8.4.24<\/p>\n<p>CHANGE THE PHP8.4 SETTING<br \/>\nMODIFY SOME INI FILES IN:<br \/>\n\/etc\/php\/8.4\/fpm\/php.ini\u00a0 &#8211;&gt; PHP-FPM\u00a0 AS MAIN<br \/>\n\/etc\/php\/8.4\/apache2\/php.ini\u00a0 &#8211;&gt;APACHE<br \/>\n\/etc\/php\/8.4\/cli\/php.ini &#8211;&gt; CLI<\/p>\n<pre class=\"lang:default decode:true\">upload_max_filesize = 4000M -&gt; (default 2M) \r\nmax_file_uploads = 4000 -&gt; (default 20) \r\npost_max_size = 4000M -&gt; (default 8M) \r\nmax_execution_time = 6000 -&gt; (default 30) in second \r\nmax_input_time = 6000 -&gt; (default 60) in second \r\nmax_input_vars = 10000 \r\nmemory_limit = 5120M -&gt; (default 128M) \r\nmemory_limit = -1 -&gt; (FOR CLI)<\/pre>\n<p>RESTART<\/p>\n<pre class=\"lang:default decode:true \">sudo systemctl restart apache2<\/pre>\n<p>CONFIG XDEBUG<\/p>\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/php\/8.4\/apache2\/conf.d\/20-xdebug.ini<\/pre>\n<p>SETTING<\/p>\n<pre class=\"lang:default decode:true \">zend_extension=xdebug.so\r\nxdebug.mode= debug\r\nxdebug.start_with_request = yes\r\nxdebug.discover_client_host = true\r\nxdebug.max_nesting_level=512\r\nxdebug.var_display_max_data = 1024\r\nxdebug.var_display_max_children = 512\r\nxdebug.var_display_max_depth = 6\r\nxdebug.idekey = VSCODE<\/pre>\n<p>&nbsp;<\/p>\n<p>FOR PHP FPM<\/p>\n<pre class=\"lang:default decode:true\">sudo systemctl restart php8.4-fpm<\/pre>\n<p>TO USE PHP8.1 WITHOUT FPM, PLS STOP PHP8.1 FPM<\/p>\n<pre class=\"lang:default decode:true \">sudo systemctl stop php8.1-fpm<\/pre>\n<p>ALSO DISABLE SOME FPM MODULES (mpm_event)<\/p>\n<pre class=\"lang:default decode:true \">sudo a2dismod mpm_event proxy_fcgi<\/pre>\n<p>IF NEEDED<\/p>\n<pre class=\"lang:default decode:true\">sudo a2disconf php8.4-fpm<\/pre>\n<p>THEN ENABLE mpm_prefork<\/p>\n<pre class=\"lang:default decode:true\">sudo a2enmod mpm_prefork<\/pre>\n<p>RELOAD<\/p>\n<pre class=\"lang:default decode:true \">sudo systemctl reload apache2<\/pre>\n<p>NOW IT&#8217;D BE RUNNING<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I already added Ond\u0159ej Sur\u00fd PPA repository. So Just install php8.4 ~$ sudo apt-get install libapache2-mod-php8.4 The apache module and cli for php8.4 is included &#8230; he following additional packages will be installed: php8.4-cli php8.4-common php8.4-opcache php8.4-readline php8.4-soap The following NEW packages will be installed: libapache2-mod-php8.4 The following packages will be upgraded: php8.4-cli php8.4-common php8.4-opcache &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2026\/08\/05\/install-php-8-4-on-ubuntu-24-04-apache\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install PHP 8.4 On Ubuntu 24.04 (Apache)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[],"class_list":["post-14265","post","type-post","status-publish","format-standard","hentry","category-php-2"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/14265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=14265"}],"version-history":[{"count":6,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/14265\/revisions"}],"predecessor-version":[{"id":14272,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/14265\/revisions\/14272"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=14265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=14265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=14265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}