wordpress - Primary script unknown

Francis Daly francis at daoine.org
Sat Aug 5 06:23:21 UTC 2023


On Thu, Aug 03, 2023 at 02:00:11PM +0200, lejeczek via nginx wrote:

Hi there,

> 2023/08/03 13:50:24 [debug] 1112963#1112963: *27 fastcgi param:
> "SCRIPT_FILENAME: /var/www/ale.xyx_wordpress/index.php"

> 2023/08/03 13:50:24 [error] 1112963#1112963: *27 FastCGI sent in stderr:
> "Primary script unknown" while reading response header from upstream,
> client: 10.3.9.144, server: ale.xyz, request: "GET / HTTP/2.0", upstream:
> "fastcgi://unix:/run/php-fpm/www.sock:", host: "ale.xyz"

> This is pretty much vanilla-default on Centos 9, those configs are - what am
> I missing?

"Primary script unknown" is a message from the fastcgi server saying
that it is unable to access the file that it has been asked to use.

Usually, that filename comes from a specific one of the SCRIPT_FILENAME
values it receives (if it receives more than one).

Your fastcgi server might log more somewhere about what it thinks it
was doing. But can you check:

can the user that the fastcgi service is running as, read the file
/var/www/ale.xyx_wordpress/index.php from the perspective of the fastcgi
service?

That is -- do directory permissions towards that file and file permissions
on that file allow that user/group to read? Does the file exist at
that path name, if the fastcgi service is running in a chroot or other
confined context? Do selinux or other access control mechanisms allow
the fastcgi service to read the file?

Some other (less likely?) possibilities include -- does your nginx send
more than one value for SCRIPT_FILENAME; and if so, is your fastcgi server
trying to use a different one? Does your fastcgi server actually use
SCRIPT_FILENAME, or does it use some other param or combination of params?

Cheers,

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list