i use php 8.2, nginx 1.26.
i set nginx to route all of url to route.php file only except just index.php file.
when i write a code echo json_encode('hello');
, it responses well shows “hello”
but when i write a code require DIR . ‘/../db/db_connection.php’, nginx shows an error
[error] 82337#0: *52 kevent() reported about an closed connection (54: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /post HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost", referrer: "http://localhost/"
index.php file is served well, simple code works well in route.php. but when i try to import other php files, Nginx shows me an error page.
I tried to run php server php -S localhost:8000
without nginx. in the server, My db connection code works perfectly.
I don’t get what is going on right now.
Nginx doesn’t wait required file’s proccessing?