Author Topic: PHP not work at Nginx & Varnish & Apache (php-fpm)  (Read 14157 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
PHP not work at Nginx & Varnish & Apache (php-fpm)
« on: July 11, 2019, 06:02:45 PM »
Apache don't read php files. I got:

Code: [Select]
Not Found
The requested URL /index.php was not found on this server.

The file exist, permissions are ok. Server read from user directiories, html files works ok.
PS. Default instalation don't set right ports for apache...

/etc/httpd/logs/error_log

Code: [Select]
[Thu Jul 11 19:36:36.826031 2019] [mpm_prefork:notice] [pid 5158] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips configured -- resuming normal operations
[Thu Jul 11 19:36:36.826045 2019] [core:notice] [pid 5158] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Jul 11 19:40:58.587454 2019] [autoindex:error] [pid 5159] [client 127.0.0.1:38370] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
[Thu Jul 11 19:41:49.077536 2019] [autoindex:error] [pid 5161] [client 127.0.0.1:38386] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive

I don't know, why it want generate server directory index, but i have index.php at user directory, which I want set up. when i put index.html all works ok, but I can't run any php no matter that it is index or other file
« Last Edit: July 11, 2019, 06:28:12 PM by skyref »

Offline
*
Re: PHP not work at Nginx & Varnish & Apache (php-fpm)
« Reply #1 on: July 12, 2019, 09:31:48 PM »
I found also, that it don't generate users cfg for socket to php-fpm. (I copy nobody and change cfg to user name) after that socket for user appear.
I suppose that is problem with php-fpm config or with apache cfg how use cwp-phpfpm (at that name php-fpm show).

Offline
*
Re: PHP not work at Nginx & Varnish & Apache (php-fpm)
« Reply #2 on: July 12, 2019, 11:05:07 PM »
I found at /var/log/cwp/webservers.log:

Code: [Select]
2019-07-12 12:07:07 domain.xyz Varnish: SUCCESS conf enabled template: default
2019-07-12 12:07:07 domain.xyz Apache: SUCCESS conf enabled
2019-07-12 12:07:07 domain.xyz Apache SSL: SUCCESS conf enabled template: php-fpm/default
2019-07-12 12:07:07 user PHP-FPM php-fpm71: ERROR failed at quota or security limits
2019-07-12 12:07:07 user PHP-FPM php-fpm73: ERROR failed at quota or security limits
2019-07-12 12:07:08 PHP-FPM php-fpm71: reload
2019-07-12 12:07:08 PHP-FPM php-fpm73: reload

I think that is connected with problem, but i don't know what/where check and change.

Offline
*
Re: PHP not work at Nginx & Varnish & Apache (php-fpm)
« Reply #3 on: July 13, 2019, 12:15:03 AM »
problem from log solved but still php scripts don't work:

Code: [Select]
Not Found
The requested URL /index.php was not found on this server.

I checked and it show php file from
Code: [Select]
/var/www/html but as plain text. PHP don't interprete it.

Where could be wrong location set per user? My config is rather default only few changes to resolve problems.. And why php not work ? Why php files are shows from other location ?
« Last Edit: July 13, 2019, 12:40:09 AM by skyref »

Offline
*
Re: PHP not work at Nginx & Varnish & Apache (php-fpm)
« Reply #4 on: July 13, 2019, 07:38:35 AM »
cwp is not using this location /var/www/html you have something bad configured there.
Probably the best would be for you to contact cwp support.

VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: PHP not work at Nginx & Varnish & Apache (php-fpm)
« Reply #5 on: July 13, 2019, 10:57:56 AM »
It is default config when you choose force php-fpm  at webservices php-fpm... (when choose without force but also php-fpm it is the same problems)
I tried new VM and got the same results. Default config also not set sockets to users, bad users, bad listen ports. Default nginx- varnish not work, varnish - apache also. Apache try listen the same ports as nginx... Already i repaired it, but still something is wrong with nginx-> php-fpm or apache->php-fpm. Yes i tried both default servers config from panel.

And when you choose php fpm you need also configure each domain othervise get bad gateway. It is not work out of box...
I will not pay for smth that should work.

This problems looks like still actual:

http://forum.centos-webpanel.com/php/php-fpm-socket-not-create/
http://forum.centos-webpanel.com/php/php7-17-2-where-is-the-php-fpm-server/
http://forum.centos-webpanel.com/php/php-fpm-not-generating-user-config-file/
http://forum.centos-webpanel.com/php/php-not-working-for-new-account/
http://forum.centos-webpanel.com/php/error-503-for-wordpress-on-php-fpm-7-3-4/
https://www.icozens.com/cwp-502-bad-gateway-cwpsrv/
https://forum.centos-webpanel.com/php/configure-php-7-with-nginx-in-cwp/
http://forum.centos-webpanel.com/centos-webpanel-bugs/php-switcher-fails-to-install-phpvx-php-fpm-and-dependencies/
http://forum.centos-webpanel.com/php/php-version-vs-php-fpm-version/
http://forum.centos-webpanel.com/php-selector/php-fpm-not-working-(503-service-unavailable)/msg24312/#msg24312
http://forum.centos-webpanel.com/php/php-fpm-and-apache2-issue/msg20319/#msg20319
« Last Edit: July 13, 2019, 11:41:07 AM by skyref »