#NEWLINE# @ classmethod #NEWLINE# def _check_php_version( cls , php_executable_path , env ) : #NEWLINE# #INDENT# 'Check if php-cgi has the correct version.' #NEWLINE# version_process = safe_subprocess . start_process ( [ php_executable_path , '-v' ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE , env = env ) #NEWLINE# ( version_stdout , version_stderr ) = version_process . communicate ( ) #NEWLINE# if version_process . returncode : #NEWLINE# #INDENT# raise _PHPEnvironmentError ( ( '"%s -v" returned an error [%d]\n%s%s' % ( php_executable_path , version_process . returncode , version_stderr , version_stdout ) ) ) #NEWLINE# #UNINDENT# version_match = re . search ( 'PHP (\\d+).(\\d+)' , version_stdout ) #NEWLINE# if ( version_match is None ) : #NEWLINE# #INDENT# raise _PHPEnvironmentError ( ( '"%s -v" returned an unexpected version string:\n%s%s' % ( php_executable_path , version_stderr , version_stdout ) ) ) #NEWLINE# #UNINDENT# version = tuple ( ( int ( v ) for v in version_match . groups ( ) ) ) #NEWLINE# if ( version < ( 5 , 4 ) ) : #NEWLINE# #INDENT# raise _PHPEnvironmentError ( ( 'The PHP interpreter must be version >= 5.4, %d.%d found' % version ) )