New version of PHP selected, menu for 'PHP 5.6 configuration' doesn't show up for a while

Howdy Guys!

We're installing PHP 5.6 into our panel environment, and that's all gone very well -- no issues at all, really, except the odd delay in having the Services > PHP 5.6 Configuration menu item showing up in the menu for existing sites.

There's some concern that (even though everything else gets updated immediately upon their selection of the new version), the lack of configuration menu is going to confuse our customers.

Is there a way to refresh the menu cache (if that's what is needed) more quickly after the new PHP version is selected for existing sites?

Thanks!

~james

Status: 
Active

Comments

Had kinda same problem on ubuntu. Even a reboot doesnt bring the Configuration menus but they seem to appear randomly after few hours/days

Thanks guys -- yeah the menu there may be cached, but Jamie will have some thoughts on what to do about that.

You can clear the cache by deleting /etc/webmin/virtual-server/links-cache/*

However, this should be automatic. Did you change the PHP version in Virtualmin, or just install a new version from the command line?

Hi Jamie;

I think it is automatic, but doesn't happen right away -- I changed the PHP version in Virtualmin, under PHP Versions. Both for subdirectories and for the main document root.

Hmm. I don't think I answered your question -- PHP is not installed via virtualmin, but through some Puppet classes so we can enforce configuration across the panel and several web servers. So, command line I suppose.

I think that the links-cache/* solution should work just fine for us -- I'll let you know if more questions over this crop up.

Thanks!

~james

Hrm.

To be clear (sorry if I've not been), PHP does show up as available for everyone to use, that's not a problem -- it's just that the menu link for 'PHP 5.6 configuration' doesn't show for an hour or two after a site owner, via the panel, selects, to use it. Refreshing the page or logging back in doesn't do it -- it just takes a bit for that menu item to appear.

This is for existing sites, not new ones. It's reproducible, and somewhat confusing to the end user. Clearing out the link cache does do it, but that's not really feasible to do each time a customer decides to add the new version.

Ideas?

Thanks! ~james

Ah! I see -- are you saying that if we'd have used the panel to install PHP 5.6, then the 'PHP 5.6 Configuration' would just appear in everyone's menu, the way that the other versions are?

We did use a more command-line method to do the installation -- we do have to build a few extension RPMs, and can get a bit more consistency by doing it all at once, plus we have non-panel web servers to install everything on as well, so are installing it all the same way.

The way we've done it, the cgi and fcgi wrappers, and etc/php56 directories, don't even show up in site owners directories for existing sites, until they choose to use PHP 5.6. At that point, the wrappers show up, the /etc/php56 directory shows up, and the virtualhost .conf file is updated to include the new version -- so it appears to work just fine once they choose to use it, it's just that menu item takes some time to appear.

Does that help?

~james

We're like yourself, we like doing a lot of things using the CLI too.

However, Virtualmin wouldn't necessarily immediately notice a new PHP version on it's own.

Did you by chance use something like this here:

https://www.virtualmin.com/documentation/web/multiplephp

After installing a new PHP version using that, you can then tell Virtualmin about it using System Settings -> Re-Check Config, where it will detect the newly installed PHP version.

In theory, after that, it should be available to you in the menus.

But if that's not the case let us know!

Yes! Sorry, we did do that step, System Settings > Re-check Config.

New sites have everything we'd expect WRT PHP 5.6

For existing sites, PHP 5.6 becomes an option in the drop-down menu under Server Configuration > PHP Versions

...and that's the only place that PHP 5.6 is mentioned.

It's only after the site owner chooses to use PHP 5.6 that any php56 configuration is added to the existing site, and the PHP 5.6 Configuration menu item takes a couple hours to show up after that.

~james

I did run System Settings > Re-Check Configuration again, just to see - same state.

Thanks! ~james

Any updates on this, or are we stuck with the two-hour delay in the menu item appearing?

~james

So a config re-check should clear the cache immediately, just like deleted /etc/webmin/virtual-server/links-cache . Is that not happening for you?

The config re-check only happens once -- not when people choose to use PHP 5.6. The config re-check doesn't affect individual site owners choosing to use PHP 5.6, which is when the issue presents itself.

Are you saying that the config re-check should update all existing sites with all they need to use a new version of PHP? That isn't happening, all they get is an option to choose it -- no configuration updates to existing sites happen with the config re-check.

~james

Oh, I see now - I was misunderstanding what you meant by changing the PHP version.

Which page exactly in Virtualmin are your users using to select a different version?

They're using the 'Server Configuration' > PHP Versions page to update their version.

Thanks!

~james

When the PHP 5.x configuration link is missing, what files under the domain's home directory exist matching etc/php*/php.ini ?

The same ones that exist when it's present:

total 0

drwsrwsr-x. 2 utw09008 utw09008 64 May 1 2016 php5

drwsrwsr-x. 2 utw09008 utw09008 64 May 1 2016 php5.4

drwxr-sr-x. 2 utw09008 utw09008 52 Oct 11 20:42 php5.6

lrwxrwxrwx. 1 utw09008 utw09008 14 Oct 11 20:42 php.ini -> php5.6/php.ini

..and:

ls php*

php.ini

php5:

php.ini php.ini.pre-opcache

php5.4:

php.ini php.ini.pre-opcache

php5.6:

php.ini

After the 'PHP 5.6 Configuration' link appears, once the links-cache is cleared, I'm getting users who don't have access to it, though, once it's there and they click it.

Clicking on the newly-appeared 'PHP 5.6 Configuration' link under 'Services' returns: "You are not allowed to manage this PHP configuration file"

They do retain the ability to edit the configuration for previously existing PHP versions, and can also edit the ~/etc/php56/php.ini file as well. I'm just not sure where the ACL for the new link lives.

[EDIT] Ah -- so, this one seemed to have fixed itself when I re-saved the Server Template. I'm not sure if that fixed it across the board, or not, but the issue seems to have gone away after that.

Note that the original issue, with the PHP 5.6 Configuration link not appearing until the links cache is cleared (manually, or by timeout) still happens.

Thanks!

~james

Ok, I'll look into this further - it may be that the webmin permissions need to be updated following a PHP version change.