PHP-FPM fails to start scripts
[email protected] (John Iliffe)
| Newsgroups | php.general |
|---|---|
| Message-ID | <[email protected]> |
PHP-7.1.3 compiled from source, running on Fedora 25 with Apache-2.4.25
php-fpm is running but reports all scripts as "No Input File Specified" on
the browser and "ERROR: Unable to open primary script:
/httpd/iliffe//i_phpinfo.php (No such file or directory)" on the error log.
[ This script is actually phpinfo() ].
I have been working with the Apache list to try and resolve this but have
now been referred to the PHP list as not an Apache problem.
Environment: the requested script is in the document root at /httpd/iliffe
and does exist and is world readable.
------------------------
namei /httpd/iliffe/i_phpinfo.php
f: /httpd/iliffe/i_phpinfo.php
d /
d httpd
d iliffe
- i_phpinfo.php
---------------------------
The Apache directive invoking this script is:
ProxyPassMatch "^/.*\.php(/.*)?$" fcgi://127.0.0.1:9015/httpd/iliffe/
php-fpm is running on a TCP socket at 127.0.0.1:9015 It is in pool www.
Running strace on php-fpm yields the following info: (relevant bit
extracted from a 24,000 line trace report)
----------------------------
9223 12:25:52 lstat("/httpd/iliffe//i_phpinfo.php", {st_mode=S_IFREG|0644,
st_size=213, ...}) = 0
9223 12:25:52 lstat("/httpd/iliffe", {st_mode=S_IFDIR|0755, st_size=4096,
...}) = 0
9223 12:25:52 lstat("/httpd", {st_mode=S_IFDIR|0755, st_size=141, ...}) =
0
9223 12:25:52 lstat("/httpd/iliffe/.user.ini", 0x7ffe0e20ae80) = -1 ENOENT
(No such file or directory)
-------------------------------
and then about 30 lines further down the report:
-------------------------------
9223 12:25:52 lstat("/httpd/i_phpinfo.php", 0x7ffe0e208f30) = -1 ENOENT (No
such file or directory)
9223 12:25:52 write(2, "ERROR: Unable to open primary sc"..., 95) = 95
9223 12:25:52 times( <unfinished ...>
9222 12:25:52 <... epoll_wait resumed> [{EPOLLIN, {u32=27169440,
u64=27169440}}], 11, 1000) = 1
9223 12:25:52 <... times resumed> {tms_utime=0, tms_stime=0, tms_cutime=0,
tms_cstime=0}) = 486185773
9223 12:25:52 setitimer(ITIMER_PROF, {it_interval={tv_sec=0, tv_usec=0},
it_value={tv_sec=0, tv_usec=0}}, <unfinished ...>
9222 12:25:52 read(10, <unfinished ...>
9223 12:25:52 <... setitimer resumed> NULL) = 0
9222 12:25:52 <... read resumed> "ERROR: Unable to open primary sc"...,
1023) = 95
9223 12:25:52 write(3, "\1\7\0\1\0X\0\0Unable to open primary s"..., 240
<unfinished ...>
9222 12:25:52 write(3, "[20-May-2017 12:25:52] WARNING: "..., 169
<unfinished ...>
-------------------------------------
Error logging starts AFTER the second attempt to open the file on the wrong
path.
Note that the first lstat has the file (return code = 0) and it is a readable
regular file {st_mode=S_IFREG|0644, st_size=213, ...}
The second attempt doesn't get the file:
9223 12:25:52 lstat("/httpd/i_phpinfo.php", 0x7ffe0e208f30) = -1 ENOENT (No
such file or directory)
because php-fpm is looking on the wrong path. (missing second
subdirectory).
So, my questions:
1. why am I getting not found responses when php-fpm can find the script
file and is permitted to open it?
2. why, when php-fpm has found the file already does it continue to descend
the directory structure?
3. why is the second attempt on the wrong directory?
4. if this is a configuration problem on my part, where should I be looking
to correct it?
I have also downloaded and tried php-fpm from the PHP-7.1.5 and it has the
same problem.
Please let me know if any other information is required.
Thanks in advance.
John
=====================================