[Solved] Update PHP version on vhost subdomain?

Discussion in 'General' started by TonyG, Sep 26, 2023.

Tags:
  1. TonyG

    TonyG Active Member

    After updating a server PHP to 7.4.33 and adding PHP 8.2, I'm able to set primary websites to v8.2. But vhost subdomains do not show the new PHP version. To be clear - none of my vhost subdomains on any domain have the new PHP version, but all (primary) websites do.

    Ubuntu v20.04: fully updated and restarted a few times recently.
    ISPConfig v3.2.2. It looks like 3.2.11 is the same.
    Using PHP-FPM, not sure if some other PHP setting or change is relevant.

    The issue is that the subdomains are (verified) running v7.4, the system default, so I can't update some software. I want subdomains to move to v8.2, when I want to update them, without changing the server default.

    Of course, yes, I've added the PHP version to the system config for version selection. But only the primary websites seem to add the versions to the dropdown selector.

    Am I missing some config setting? What can I do about this?

    Thanks!

    Website foo.tld
    230926093325.png

    Website sub.foo.tld

    upload_2023-9-26_9-32-55.png
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I am not so sure about vhost sub domain but my vhost alias domain work just fine, I mean I can choose different php version for each aliases domain with vhost.

    I think your vhost sub domain there should also have options for php version as well because it has its own vhost.

    Or am I wrong to understand what you mean by vhost sub domain?
    IMG_20230927_081840.jpg
     
  3. TonyG

    TonyG Active Member

  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    So I guess I was right then, and there should be an option for php version, as it has its own vhost, but there was none.

    Try: force update ISPConfig reconfiguring all services, and if that is not enough to get the options, try running ISPConfig resync tool and see.

    Follow readme-before-posting and share your server debug report if the above still do not fix it.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Maybe you have chosen the wrong PHP mode in the vhost subdomain. Additional PHP versions are available only for the mode you configured them for, so if you e.g. chose mod_php, then there will never be an additional version as mod_php does not support that. Today, you should always use php-fpm btw.
     
    ahrasis likes this.
  6. TonyG

    TonyG Active Member

    Just coming back to close this thread...
    Thanks for your comments in this thread guys - I'm sorry it took so long to get back.

    PHP_FPM is used for all sites in this Apache server. There are no settings active for CGI or mod_php.

    While in this ISPConfig v3.2.2 the Subdomain-vhost settings still does not show the PHP version, I found out why many of the subdomains were still running v7.4 while their primary domain was running 8.2. I needed to make any tiny change to the subdomain-vhost config and Save. That's it. Just add an extra EOL to the end of Custom php.ini settings or Apache Directives. Or set the pm.process_idle_timeout from 10s to 11s. Any update of this record causes a regeneration of the .vhost file, setting the handler for the subdomain to the same PHP version as the parent domain.

    I'm just sharing my solution, a common solution for many purposes. And it makes perfect sense here. If this is the well-known way to update the PHP version in sites, I didn't know. Perhaps there is a better way in later point-releases of v3.2, like a "touch all" feature. That would be nice.
     
    ahrasis likes this.

Share This Page