Ubuntu 23.04
Sponsored Link

Apache2 : Use PHP Scripts2023/04/28

 
Configure Apache2 to use PHP scripts.
[1] Install PHP.
root@www:~#
apt -y install php8.1 php8.1-mbstring php-pear
[2] Install PHP module for Apache2.
root@www:~#
apt -y install libapache2-mod-php
[3] Configure Apache2.
root@www:~#
vi /etc/php/8.1/apache2/php.ini
# line 968: uncomment and add your timezone

date.timezone =
"Asia/Tokyo"
root@www:~#
systemctl reload apache2
# create a test page

root@www:~#
echo '<?php phpinfo(); ?>' > /var/www/html/info.php

[4] Verify to access to PHPInfo test page from any client computer.
Matched Content