:8080 500 mysqli_init undefined

Discussion in 'General' started by HellMind, Aug 20, 2020.

  1. HellMind

    HellMind Member

    Updated from stretch to buster.
    I know its a problem with my php installation.
    I don't know which php version the ispconfig.vhost is using.

    Code:
    2020/08/20 16:43:24 [error] 510#510: *728 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to undefined function mysqli_init() in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php on line 83" while reading response header from upstream, client: ::1, server: _, request: "POST /remote/index.php HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/ispconfig.sock:", host: "localhost:8080"
    I see that: ispconfig.vhost is dated too old, its seems never has been updated
    Sites are working ( those are using php 7.x)
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    the php-mysqli extension is missing in the default PHP version of your OS. Take care that you go step by step trough the perfect server guide that matches the new os version to install all packages, then run an ispconfig update with reconfigure services = yes to adjust the config files for your new OS version. Finally, login to ispconfig and adjust all paths under system > server config > web and on the fastcgi tab to match the paths of your new os.

    and regarding the error message you posted, the php5-fpm in the path of the error is not an indication that it uses php 5, that's just a folder name and it is used for any php version inkl php 7, so this is not a php version info.
     
  3. HellMind

    HellMind Member

    I used the perfect setup. I can't se anything missing.
    I also have reconfigured ispconfig.
    I'm still having that 500 error.
    I add more info:
    Code:
    root@ispconfig:/etc/php# php -i | grep mysqli
    /etc/php/7.4/cli/conf.d/20-mysqli.ini,
    mysqli
    mysqli.allow_local_infile => Off => Off
    mysqli.allow_persistent => On => On
    mysqli.default_host => no value => no value
    mysqli.default_port => 3306 => 3306
    mysqli.default_pw => no value => no value
    mysqli.default_socket => no value => no value
    mysqli.default_user => no value => no value
    mysqli.max_links => Unlimited => Unlimited
    mysqli.max_persistent => Unlimited => Unlimited
    mysqli.reconnect => Off => Off
    mysqli.rollback_on_cached_plink => Off => Off
    API Extensions => mysqli,pdo_mysql
    it seems that extension its intalled.
    Maybe ispconfig :8080 is using a different version than the system one.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The system PHP on Debian Buster is version 7.3 and not 7.4.
     
  5. HellMind

    HellMind Member

    It seems the extension its active for 7.3 too.
    Code:
    /etc/php/7.3/cli/conf.d/20-mysqli.ini,
    mysqli
    mysqli.allow_local_infile => Off => Off
    mysqli.allow_persistent => On => On
    mysqli.default_host => no value => no value
    mysqli.default_port => 3306 => 3306
    mysqli.default_pw => no value => no value
    mysqli.default_socket => no value => no value
    mysqli.default_user => no value => no value
    mysqli.max_links => Unlimited => Unlimited
    mysqli.max_persistent => Unlimited => Unlimited
    mysqli.reconnect => Off => Off
    mysqli.rollback_on_cached_plink => Off => Off
    API Extensions => mysqli,pdo_mysql
    
    How can I be sure which version ispconfig is using for 8080?
     
  6. HellMind

    HellMind Member

    Also every php version installed got mysqli extension active. But php5
    Also I dont like having 2 config dirs for php5

    Code:
    root@ispconfig:/etc/php# ls -la /etc/php*
    /etc/php:
    total 40
    drwxr-xr-x   8 root root  4096 Dec 20  2019 .
    drwxr-xr-x 123 root root 12288 Aug 20 16:21 ..
    drwxr-xr-x   3 root root  4096 Apr 27  2017 5.6
    drwxr-xr-x   6 root root  4096 Apr 27  2017 7.0
    drwxr-xr-x   6 root root  4096 Apr 27  2017 7.1
    drwxr-xr-x   7 root root  4096 May  8  2018 7.2
    drwxr-xr-x   7 root root  4096 Aug 20 15:51 7.3
    drwxr-xr-x   5 root root  4096 Apr  9 12:09 7.4
    
    /etc/php5:
    total 32
    drwxr-xr-x   6 root root  4096 Mar 18  2017 .
    drwxr-xr-x 123 root root 12288 Aug 20 16:21 ..
    drwxr-xr-x   2 root root  4096 Jul  8  2018 apache2
    drwxr-xr-x   3 root root  4096 Jul  8  2018 cli
    drwxr-xr-x   4 root root  4096 Jul  8  2018 fpm
    drwxr-xr-x   2 root root  4096 Mar 18  2017 mods-available
     
  7. HellMind

    HellMind Member

    I purged an old php5 package installed , maybe from stretch, also remove all php5 related.
    Reinstalled php5.6 (which is seems ispconfig still uses it)
    How I get a different error:
    Code:
    2020/08/20 17:59:48 [crit] 747#747: *2 connect() to unix:/var/lib/php5-fpm/ispconfig.sock failed (2: No such file or directory) while connecting to upstream, client: 186.108.209.136, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/ispconfig.sock:", host: "myhost.com:8080"
    It seems the sock wasn't updated to use php5.6 , how can I force ispconfig to use another version if I cant login to the panel.
     
  8. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    /etc/php5/ is probably from very old php packages, which you might be able to purge, and remove anything left there afterwards (maybe rename it temporarily to make sure nothing there is being accessed and lost).

    Be sure you change your default php version to 7.3. That should look like
    Code:
    # ls -l /etc/alternatives/*php*
    lrwxrwxrwx 1 root root 15 Mar  4 17:09 /etc/alternatives/php -> /usr/bin/php7.3
    lrwxrwxrwx 1 root root 31 Mar  4 17:09 /etc/alternatives/php.1.gz -> /usr/share/man/man1/php7.3.1.gz
    lrwxrwxrwx 1 root root 19 Mar  4 17:42 /etc/alternatives/php-cgi -> /usr/bin/php-cgi7.3
    lrwxrwxrwx 1 root root 35 Mar  4 17:42 /etc/alternatives/php-cgi.1.gz -> /usr/share/man/man1/php-cgi7.3.1.gz
    lrwxrwxrwx 1 root root 23 Mar  4 17:42 /etc/alternatives/php-cgi-bin -> /usr/lib/cgi-bin/php7.3
    
    Other than that, you could have problems in init scripts where php daemons aren't getting stopped/started correctly. Try stopping/starting php daemons by hand and see if you kick things into a working state.

    Once you have ISPConfig back online, be sure to go into System > Server Config > {server} > Web > PHP Settings and update everything there.
     
  9. HellMind

    HellMind Member

    Fixed, Thank you both
    I reinstalled all php related fcgi , reconfigured everything.
    Regenerate ispconfig (update procedure)
    I fixed coping the old php5 pool ispconfig.conf to the new php7.3 pool folder
    I don't know why the update script didn't generate ispconfig.conf again. ( thats why ispconfig.sock wasnt created without any error)
     
  10. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    I don't see it mentioned, but what version of ISPConfig do you have installed? The stable-3.1 code has some new PHP version handling, perhaps there could be an issue in updating as you did? I don't suspect that offhand, just tossing it out as a possibility.
     
  11. HellMind

    HellMind Member

    ISPConfig Latest stable version.
    Still im having issues, i added a site and no nginx conf is created. I see no error.
     
  12. HellMind

    HellMind Member

    Debugin I get:

    Code:
    21.08.2020-15:49 - DEBUG - Calling function 'update' from plugin 'apps_vhost_plugin' raised by event 'server_update'.
    PHP Warning:  file_put_contents(/etc/php5/fpm/pool.d/apps.conf): failed to open stream: No such file or directory in /usr/local/ispconfig/server/plugins-available/apps_vhost_plugin.inc.php on line 223
    It seems taht apps?vhost?plugins is wrong! , there must be a var that is set to: /etc/php5/
     
  13. HellMind

    HellMind Member

    How ispconfig, knows that the apps.conf is there:
    /etc/php5/fpm/pool.d/
    Which var it uses, where it stores it?
     
  14. HellMind

    HellMind Member

    I created a symbolink link to the new php 7.3 location, I get no error, but still doesnt work, site files aren't being created
     
  15. HellMind

    HellMind Member

    I found this:
    Maybe I need to update it
    upload_2020-8-21_18-7-21.png
     
  16. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Till explained what you need to do here ^
     
  17. HellMind

    HellMind Member

    Yes I did that.
    I cant see the fastcgi tab
    Or what should I put there.
     
  18. HellMind

    HellMind Member

    This is strange, I made some changes , now I see the fastcgi tab.
     
  19. HellMind

    HellMind Member

    It seems the fastcgi tabs only appers if server_type is set to apache2,
    my server_type turned to apache after I disable the checkbox: Apps Vhost Settings
     
  20. HellMind

    HellMind Member

    Still ispconfig, doesn't create o modify sites:
    But I see that apps.vhost was regenerated, How is that it can do that but cant change the others files :S
    Code:
    root@ispconfig:/etc/nginx/sites-available# ls -la
    total 84
    drwxr-xr-x 2 root root  4096 Aug 20 23:27 .
    drwxr-xr-x 6 root root  4096 Aug 20 23:29 ..
    -rw-r--r-- 1 root root 10870 Aug 22 11:15 apps.vhost
    -rw-r--r-- 1 root root  1740 Mar 19  2017 c.com.vhost
    -rw-r--r-- 1 root root  1874 Oct 27  2016 default
    -rw-r--r-- 1 root root  1743 Apr  4 10:58 d.com.vhost
    -rw-r--r-- 1 root root  2396 Jun 12 19:46 f.me.vhost
    -rw-r--r-- 1 root root  1656 Mar 19  2017 g.net.vhost
    -rw-r--r-- 1 root root  3813 Aug 20 23:27 ispconfig.vhost
    -rw-r--r-- 1 root root  2689 Apr 10 10:47 h.com.vhost
    -rw-r--r-- 1 root root  3411 Mar  5 11:29 i.org.vhost
    -rw-r--r-- 1 root root  2945 Jun 24 10:19 j.com.vhost
    -rw-r--r-- 1 root root  1451 May  3  2017 k.com.vhost
    -rw-r--r-- 1 root root  3025 Jul  8  2018 l.com.vhost
    -rw-r--r-- 1 root root  2419 Jul 27 12:01 m.vhost
    -rw-r--r-- 1 root root  5622 Jun 23 17:44 o.vhost
    -rw-r--r-- 1 root root  2459 Mar  9  2019 n.org.vhost
    -rw-r--r-- 1 root root  3334 Jul 27 10:31 q.vhost
     

Share This Page