Installation issue - nginx - linux raspberry pi zero - SAVE AS index.php... new guy problem, probably...

26 views
Skip to first unread message

James Van Dorn

unread,
Oct 20, 2025, 2:28:50 AMOct 20
to Easy!Appointments - Support Group
Hello!

I am excited to try and move off of SQUARE
and use your product...

Gazelle has some type of prioritizing scheduling by location
which I might do later, when I have more clients...

but for now, until I start to have traveling issues
 https://piano.vandorn.net

I may also start a music lessons teaching schedule
as another side hustle, too.

thank you for your assistance on this experiment/project.

Jim

----------------------------------------------------------

Installation:
   nginx on Linux 17 via ssh
   192.168.0.2 (Static)

Error:

 - if I try to access index.php or *.php
      it tries to save the php file as SAVE AS
         via Windows Explorer screen...

I will try and retrace steps :

Context:
   ssh from Windows 10 into a Raspberry Pi Zero 2W...
  using nginx version: nginx/1.22.1

php -v
PHP 8.2.29 (cli) (built: Jul  3 2025 16:16:05) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.29, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.29, Copyright (c), by Zend Technologies
---------------------------------------

/etc/nginx/sites-available/easyappointments

server {
    listen 80;
    server_name 192.168.0.2;

    root /var/www/html/easyappointments;
    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; # Adjust PHP version if needed
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all; # Block access to .htaccess or similar files
    }
}

--------------------------------------

>php -v

PHP 8.2.29 (cli) (built: Jul  3 2025 16:16:05) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.29, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.29, Copyright (c), by Zend Technologies


--------------------------------------
sudo apt install apache2 mariadb-server php php-cli php-mysql libapache2-mod-php php-json php-curl php-intl php-mbstring php-zip -y
--------------------------------------
sudo chown -R www-data:www-data /var/www/easyappointments
sudo chown -R www-data:www-data /var/www/html/easyappointments/storage

sudo mysql_secure_installation
--------------------------------------
sudo systemctl status php8.2-fpm
● php8.2-fpm.service - The PHP 8.2 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php8.2-fpm.service; enabled; preset: enabled)
     Active: active (running) since Sun 2025-10-19 22:11:11 CDT; 2h 36min ago
       Docs: man:php-fpm8.2(8)
   Main PID: 50884 (php-fpm8.2)
     Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0.00req/sec"
      Tasks: 3 (limit: 170)
        CPU: 1.210s
     CGroup: /system.slice/php8.2-fpm.service
             ├─50884 "php-fpm: master process (/etc/php/8.2/fpm/php-fpm.conf)"
             ├─50885 "php-fpm: pool www"
             └─50886 "php-fpm: pool www"

Oct 19 22:11:11 pialla systemd[1]: Starting php8.2-fpm.service - The PHP 8.2 FastCGI Process Manager...
Oct 19 22:11:11 pialla systemd[1]: Started php8.2-fpm.service - The PHP 8.2 FastCGI Process Manager.
--------------------------------------
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
--------------------------------------
sudo systemctl reload nginx
--------------------------------------
sudo find /var/www/html/easyappointments -type d -exec chmod 755 {} \D;
and I ALSO did 644 to the files (-type f) ; took a little bit of time...
--------------------------------------
ps -ef | grep nginx
root         750       1  0 Oct18 ?        00:00:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
root       15927       1  0 Oct19 ?        00:00:00 sudo nano /etc/nginx/sites-available/easyappointments
root       15928   15927  0 Oct19 ?        00:00:00 sudo nano /etc/nginx/sites-available/easyappointments
root       15929   15928  0 Oct19 ?        00:00:00 nano /etc/nginx/sites-available/easyappointments
www-data   82838     750  0 Oct19 ?        00:00:00 nginx: worker process
www-data   82839     750  0 Oct19 ?        00:00:00 nginx: worker process
www-data   82840     750  0 Oct19 ?        00:00:00 nginx: worker process
www-data   82841     750  0 Oct19 ?        00:00:00 nginx: worker process
pi-alpha   83617   83412  0 00:52 pts/2    00:00:00 grep --color=auto nginx
--------------------------------------
error.log is empty
it did give me a Restricted/denied/ i cant remebmer

but now,

if I try to access index.php or *.php
it tries to save the php file as SAVE AS via Windows Explorer screen...

--------------------------------------
sudo nano /var/www/html/easyappointments/config.php

// Base URL for subdirectory installation
// define('URL', 'http://localhost/easyappointments/');
// define('DB_HOST', 'localhost');
// define('DB_NAME', 'easyappointments');  changed to ez
// define('DB_USER', 'pi-alpha');
// define('DB_PASS', '********');

$config['base_url'] = 'http://192.168.0.2/easyappointments/';
$config['db_host'] = 'localhost';
$config['db_name'] = 'ez';
$config['db_user'] = 'pi-alpha';
$config['db_pass'] = '********');

// Optional: Google Calendar sync keys (create in Google Cloud Console first)
// define('GOOGLE_CALENDAR_API_KEY', 'your_api_key');
// define('GOOGLE_CALENDAR_CLIENT_ID', 'your_client_id');
// define('GOOGLE_CALENDAR_CLIENT_SECRET', 'your_client_secret');

// I stuck below in - REM'd out, so I could remember it...

// MariaDB [(none)]> show databases;
// +--------------------+
// | Database           |
// +--------------------+
// | easy_appointments  |
// | ez                 |
// | information_schema |
// | mysql              |
// | performance_schema |
// | sys                |
// +--------------------+

--------------------------------------
sudo nano index.html
I ran a dummy html file and it worked from var www html easyappointments
--------------------------------------

Again,

Thank you for any assistance you might give...

~ Jim

James Van Dorn

unread,
Oct 20, 2025, 3:27:13 AMOct 20
to Easy!Appointments - Support Group
additional information

sudo nano /var/log/nginx/error.log
$ sudo tail -f /var/log/php8.2-fpm.log
[20-Oct-2025 01:39:29] NOTICE: Terminating ...
[20-Oct-2025 01:39:29] NOTICE: exiting, bye-bye!
[20-Oct-2025 01:39:50] NOTICE: fpm is running, pid 554
[20-Oct-2025 01:39:50] NOTICE: ready to handle connections
[20-Oct-2025 01:39:50] NOTICE: systemd monitor interval set to 10000ms
[20-Oct-2025 02:03:24] NOTICE: Terminating ...
[20-Oct-2025 02:03:24] NOTICE: exiting, bye-bye!
[20-Oct-2025 02:03:45] NOTICE: fpm is running, pid 555
[20-Oct-2025 02:03:45] NOTICE: ready to handle connections
[20-Oct-2025 02:03:45] NOTICE: systemd monitor interval set to 10000ms
        ^Z
[5]+  Stopped                 sudo tail -f /var/log/php8.2-fpm.log

thank you

Mn So

unread,
Oct 20, 2025, 3:47:42 AMOct 20
to Easy!Appointments - Support Group
You mentioned you 644'ed the www-data directory -- did you 644 them TO the www:data user?

www-data user is the user that's going to be serving files through php-fpm from NGINX, and if www-data can't read them because they're 644d to a different user, that is likely the problem. 

Outside of that:
Further random checks but truly the above should fix it, 98% of the time that's the problem:

What's the default_type defined in your /etc/nginx/nginx.conf? If it's not application/index.html -- that could be another problem.

I would check /etc/nginx/mime.types and ensure it exists, is populated, and is properly defining the types of files your NGINX instance is serving the way you want them to be interpreted. 

Honestly before any of that, I know you were unable to provide all of the steps you took, but I did not see anything related to actually opening ports, and you mentioned you were getting forbidden is assume you mean 403 Forbidden big black line 'NGINX' underneath it?

Interesting that you're not getting any errors in NGINX when attempting to hit your URL. 

What happens when you simply curl the URL from your terminal? 

The same curl commands above appending ":80" to the end of the IP address.

If all else fails, you can always tcpdump --- I'm joking, you shouldn't even have to read this far, it's probably just permissions. 😂🤣
Reply all
Reply to author
Forward
0 new messages