Re: Getting PHP-FPM working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello John,

Is ChrootDir activated?

regards,

Christian

On Mon, May 15, 2017 at 10:42:37AM -0400, John Iliffe wrote:
> Hi Christian:
> 
> I just noticed that you put "" around the parameters to ProxyPassMatch.
> 
> I tried that and no change in the results.
> 
> John
> ================================
> On Monday 15 May 2017 05:21:59 Christian Hettler wrote:
> > Hello John,
> > 
> > the manual (mod_proxy_fcgi.html) states:
> > 
> > "The request URL is implicitly added to the 2nd parameter."
> > 
> > (Did|Can) you try
> > 
> > ProxyPassMatch "^/.*\.php(/.*)?$" "fcgi://127.0.0.1:9015/httpd/iliffe/"
> > 
> > instead of
> > 
> > > #   ProxyPassMatch ^/(.*\.php(/.*)?)$
> > > fcgi://127.0.0.1:9015/httpd/iliffe/$1
> > 
> > regards,
> > 
> > Christian
> > 
> > On Sat, May 13, 2017 at 03:43:08PM -0400, John Iliffe wrote:
> > > I'm not sure is this is the correct list to post these questions to,
> > > since I now have things isolated to a single module in PHP-FPM, so
> > > please redirect me if necessary.  This is a continuation of the
> > > problems I was having (on this list) installing a new server last
> > > month.
> > > 
> > > ---------------------
> > > Summary: PHP-FPM will not execute any scripts; it is set up according
> > > to the PHP-FPM Wiki documentation so far as I can see.
> > > ---------------------
> > > 
> > > O/S  Fedora 25, Apache 2.4.25 compiled from source, PHP 7.1.3 compiled
> > > from source.
> > > 
> > > I did a clean install of PHP-7.1.3 for testing, PHP-FPM is running
> > > under its own user/group phpfpm.  Set up as listen  on 127.0.0.1:9015
> > > in pool www.  Document root in www.conf is /httpd/iliffe which has
> > > been set to world readable, SELinux is set to permissive so it isn't
> > > in the equation.  Log level on PHP is debug.  All available log info
> > > is at the end of this memo.
> > > 
> > > It seems obvious to me that the proxy_fcgi module is worked as
> > > expected and that the problem is somewhere in PHP-FPM.
> > > 
> > > mod_php was tried as a check on the installation and works OK when
> > > enabled.
> > > 
> > > I am using the minimalist proxy configuration in Apache, (the target
> > > PHP script is hard coded to avoid regex errors) and the target PHP
> > > script file is being reported correctly by both Apache and PHP-FPM. 
> > > I checked by su as the phpfpm user and I can read this file, no
> > > problems at all.
> > > 
> > > The problem has been traced to fpm_main.c, specifically the following:
> > > 
> > > -----------------------------
> > > if (UNEXPECTED(php_fopen_primary_script(&file_handle) == FAILURE)) {
> > > 
> > > 		zend_try {
> > > 		
> > > 			zlog(ZLOG_ERROR, "Unable to open primary script: %s (%s)",
> > > 			primary_script, strerror(errno)); if (errno == EACCES) {
> > > 			
> > > 				SG(sapi_headers).http_response_code = 403;
> > > 				PUTS("Access denied.\n");
> > > 			
> > > 			} else {
> > > 			
> > > 				SG(sapi_headers).http_response_code = 404;
> > > 				PUTS("No input file specified.\n");
> > > 
> > > --------------------------------
> > > 
> > > Changing the script path in httpd.conf leads to a browser File Not
> > > Found error as would be expected.  The document root in httpd.conf
> > > and in www.conf (PHP pool conf file for this pool) are the same.
> > > 
> > > In Apache, the minimum is set in httpd.conf:
> > > 
> > > # Default host (www.iliffe.ca)
> > > # This one picks up all IP based hacker garbage too
> > > <VirtualHost *:80>
> > > 
> > >    ServerName www.iliffe.ca
> > >    DocumentRoot /httpd/iliffe
> > >    Options FollowSymLinks
> > >    H2Direct on
> > > 
> > > #   ProxyPassMatch ^/(.*\.php(/.*)?)$
> > > fcgi://127.0.0.1:9015/httpd/iliffe/$1
> > > 
> > >   ProxyPassMatch ^/info$
> > >   fcgi://127.0.0.1:9015/httpd/iliffe/i_phpinfo.php
> > > 
> > > As far as I can see, all necessary Apache modules are loaded:
> > > 
> > > # /usr/apache-2.4.25/bin/httpd -M
> > > 
> > > Loaded Modules:
> > >  core_module (static)
> > >  so_module (static)
> > >  http_module (static)
> > > 
> > > **** big list of modules skipped here****
> > > 
> > >  proxy_module (shared)
> > >  proxy_connect_module (shared)
> > >  proxy_http_module (shared)
> > >  proxy_fcgi_module (shared)
> > >  ssl_module (shared)
> > >  unixd_module (shared)
> > >  http2_module (shared)
> > >  status_module (shared)
> > > 
> > > ******more modules skipped here****
> > > 
> > > I'm completely stuck here and any ideas or assistance would be
> > > appreciated.
> > > 
> > > Regards,
> > > 
> > > John
> > > 
> > > All following errors from one screen access:
> > > -------------------------
> > > PHP-FPM log:
> > > [13-May-2017 14:40:33.423449] DEBUG: pid 16444,
> > > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www]
> > > currently 0 active children, 2 spare children, 2 running children.
> > > Spawning rate 1 [13-May-2017 14:40:34.265891] WARNING: pid 16444,
> > > fpm_stdio_child_said(), line 197: [pool www] child 16445 said into
> > > stderr: "ERROR: main(), line 1947: Unable to open primary script:
> > > /httpd/iliffe/i_phpinfo.php (No such file or directory)"
> > > [13-May-2017 14:40:34.265952] DEBUG: pid 16444, fpm_event_loop(), line
> > > 419: event module triggered 1 events
> > > [13-May-2017 14:40:34.424195] DEBUG: pid 16444,
> > > fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www]
> > > currently 0 active children, 2 spare children, 2 running children.
> > > Spawning rate 1 ----------------------------
> > > 
> > > Apache Access Log:
> > > 206.248.138.118 - - [13/May/2017:14:40:34 -0400] "GET /info HTTP/1.1"
> > > 404 25 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
> > > Firefox/45.0"
> > > ------------------------------
> > > 
> > > Apache Error Log:
> > > [Sat May 13 14:40:34.266066 2017] [proxy_fcgi:error] [pid 16122:tid
> > > 140525759854336] [client 206.248.138.118:57270] AH01071: Got error
> > > 'Unable to open primary script: /httpd/iliffe/i_phpinfo.php (No such
> > > file or directory)\n'
> > > -------------------------------
> > > 
> > > Browser Screen Error:
> > >    No input file specified.
> > > 
> > > --------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux