Buat kamu yang pengen jalanin file PHP, kamu ga perlu install PHP ataupun web server, kamu bisa menggunakan docker.

Caranya, buat docker-compose.yml

web:
 image: navidonskis/nginx-php5.6
 container_name: web
 restart: always
 ports:
  - 81:81
 volumes:
  - /home/ipang/embersharing/docker/navidonskis/www:/var/www
  - /home/ipang/embersharing/docker/navidonskis/sites-enabled:/etc/nginx/sites-enabled

Selanjutnya buat file config nya, di sini saya beri nama default simpan di folder sites-enabled

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

        root /var/www/;

        # Add index.php to the list if you are using PHP
        index index.php

        server_name localhost;

        location / {
                try_files $uri $uri/ =404;
        }
        location ~ \.php$ {
	  	try_files $uri /index.php =404;
                fastcgi_pass unix:/run/php/php5.6-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
	}


        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
               deny all;
        }

}

Berikut susunan file dan folder nya (sesuaikan dengan config di docker-compose.yml)

Susunan Folder

Susunan Folder

Selanjutnya tinggal docker-compose up, lalu buka localhost:81

Tampilan di Browser

Tampilan di Browser