These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Which PHP version on the new forum.
hi
is there some way i can get a list of all the virtual servers and which php version they are set to use?
im trying to get rid of an older one, but am unsure which servers are using it and i cant seem to find a way to see which is using what
thanks
I don't see a direct way to do it, but the "virtualmin list-php-directories" command could be used to build such a list pretty easily.
Something like:
This has output like this:
Directory Version
---------------------------------------------------------------------- -------
/home/clone/public_html 5
Directory Version
---------------------------------------------------------------------- -------
/home/commerce/public_html 5.6
Directory Version
---------------------------------------------------------------------- -------
/home/dev/public_html 5.6
Directory Version
---------------------------------------------------------------------- -------
/home/gogs/public_html 5
Directory Version
---------------------------------------------------------------------- -------
/home/practice/public_html 5.6
Directory Version
---------------------------------------------------------------------- -------
/home/sofresh/public_html 5
You could grep -v the Directory line and the ---- line, if you wanted to be able to script with it (or use the --multiline flag, which doesn't include the formatting, but does have a more complex output, including the full PHP version and the execution mode) but if you're just scanning a list to see if an old version is being used, it doesn't have to be pretty.
--
Check out the forum guidelines!
ahh that is awesome :)
thanks a lot for that... it gives me exactly what im after :)
That's great @joe really good example. I also found a crude but fast way to do this, which is just to check which version is currently mapped to handle the plain '.php' extension:
grep '^FCGIWrapper.\+php$' /etc/conf/httpd.conf
FCGIWrapper /home/foo/fcgi-bin/php5.5.fcgi .php
FCGIWrapper /home/bar/fcgi-bin/php5.6.fcgi .php
...