Sugeng rawuh

#3 Install & Konfigurasi PHP di Nginx Ubuntu

Instalasi PHPMyadmin pada server nginx Ubuntu

1. Perbarui perangkat lunak

  sudo apt-get update && sudo apt-get upgrade -y

2. Install PHP

 apt install php8.2 php8.2-fpm

3. Check list

 ls /var/var/run/php/php     



4. Setting Block untuk akses PHP

 vim /etc/nginx/site-available

index.html

 server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/html;
        index index.php index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
                try_files $uri $uri/ =404;
        }

        # pass PHP scripts to FastCGI server
        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php8.2-fpm.sock;
        }
 }

Simpan dan keluar

Restart / Reload server

 sudo systemctl reload nginx

5. Buat file index.php

Buat file index.php pada folder domain anda untuk test apakah ekstensi php berjalan dengan normal
<?php
phpinfo();
?>

6. Uji coba file index.php 


Selanjutnya : 

Share:

0 comments:

Post a Comment

Tonton video



Yuk, SUBSCRIBE

omfiki.blogspot.com