diff --git a/rattail_fabric/apache.py b/rattail_fabric/apache.py index b9bf70a..8061271 100644 --- a/rattail_fabric/apache.py +++ b/rattail_fabric/apache.py @@ -51,6 +51,17 @@ def get_version(): return float(match.group(1)) +def get_php_version(): + """ + Fetch the version of PHP running on the target system + """ + result = sudo('php --version') + if result.succeeded: + match = re.match(r'^PHP (\d+\.\d+)\.\d+-', result) + if match: + return float(match.group(1)) + + def install_wsgi(python_home=None, python3=False): """ Install the mod_wsgi Apache module, with optional ``WSGIPythonHome`` value.