php-fpm (chroot) over fast-cgi

Discussion in 'ISPConfig 3 Priority Support' started by tr909192, Jul 1, 2021.

  1. tr909192

    tr909192 Member HowtoForge Supporter

    Dear,
    sorry for bothering, i have opened this new ticket instead to going ahead on the original one (https://www.howtoforge.com/community/threads/wordpress-defaced-with-anonymousfox.87207/) because the topic is little bit different.
    I'm going to try to switch on few website the php from my lovely fast-cgi to php-fpm. Because due a problem already described on the original topic i'd like to improve the "chroot" of the website (if possibile make it better than open_basedir one). But i have a couple of problems, that seems not to be discussed before:

    1) With PHP-FPM (chroot on) the mysql can connect to the mysql server only via 127.0.0.1 and not via localhost. Anyone known why that happens?
    2) Actually running an example website on PHP-FPM (with a wordpress app over it) we got a problem with the timezone, like this:

    [Wed Jun 30 15:48:32.949347 2021] [proxy_fcgi:error] [pid 7224] [client x:60565] AH01071: Got error 'PHP message: PHP Warning: timezone_open(): Unknown or bad timezone (Europe/Rome) in /web/wp-includes/functions.php on line 5690PHP message: PHP Fatal error: date_create(): Timezone database is corrupt - this should *never* happen! in /web/wp-includes/functions.php on line 5691'

    This, to me, seems a chroot related problem, and this https://git.ispconfig.org/ispconfig/ispconfig3/-/issues/5736 confirm that. But on that issue it's looks like as Implemented in 3.2. Due a couple of nodes at this time can't be upgraded to 3.2 (now are in 3.1.15p3), is it possible to known what is the specific modification you have did in order to solve this, in order to put in the local installation that we have?

    ty
     
    Last edited: Jul 1, 2021
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    That's right, you have to use the localhost IP address. localhost in MySQL is a connection over the global mysql socket file, not over the network, and this global socket file is outside of the jail, so it can't be reached from inside the jail.

    The issue has been fixed, but maybe the jail on the effected site is older (created for a jailed shell user or cronjob in the past) and does not contain the timezone database yet. Check if the timezone database exists in the jail and if not, try to copy it again to the jail.
     
    tr909192 likes this.

Share This Page