diff --git a/05_php_addressbook.md b/05_php_addressbook.md new file mode 100644 index 0000000..f9a23bb --- /dev/null +++ b/05_php_addressbook.md @@ -0,0 +1,99 @@ +# Enable PHP in Nginx + +run in bash: + +```bash +sudo apt install php-fpm -y +``` + +get php version/sock + +```bash +ls -l /run/php/*.sock +``` + +add to nginx config (server section): + +```nginx +# pass PHP scripts to FastCGI server +# +location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php8.4-fpm.sock; # <-- use version from output above! +} +``` + +validate nginx configuration & restart if ok: + +```bash +sudo nginx -t +sudo systemctl reload nginx +``` + +create Demo-App: + +```bash +sudo vi /var/www/*domain-name*/*webapp*.php +``` + +## Demo Webapp (Addressbook) + +```php + + + + +
+