This content originally appeared on DEV Community and was authored by Automata
Install PHP:
sudo apt install php8.3
Install PHP module of Apache:
apt install libapache2-mod-php
Config PHP Module of Apache
By default, the PHP module is automatically enabled, if for some reason it is not enabled, you should run:
a2enmod php8.3
To update the PHP module configuration you must modify the files /etc/apache2/mods-enabled/php8.3.conf
and /etc/apache2/mods-enabled/php8.*.load
. Then you must restart the apache server by running the following command:
systemctl restart apache2.service
Confirm Installation
php -v
Optional Packages
PHP-CLI
Run PHP scripts via the CLI
apt install php-cli
PHP-CGI
Execute PHP scripts without installing the Apache PHP module
sudo apt install php-cgi
PHP-MySQL
apt install php-mysql
PHP-PgSQL
apt install php-pgsql
This content originally appeared on DEV Community and was authored by Automata
Automata | Sciencx (2024-06-17T00:33:48+00:00) Install PHP 8.3 and config Apache in Ubuntu 22.04. Retrieved from https://www.scien.cx/2024/06/17/install-php-8-3-and-config-apache-in-ubuntu-22-04/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.