def METHOD_NAME():
    """find_php() -> php_binary
       Try to locate the PHP binary in various sensible places.
    """
    path = os.getenv("PATH") or '/bin:/usr/bin'
    paths = path.split(os.pathsep)
    for dir in path.split(os.pathsep) + \
        ['/usr/local/bin', '/usr/bin', '/software/bin', '/opt/bin', '/opt/php/bin']:
        for name in ['php4', 'php', 'php4-cgi', 'php-cgi']:
            if os.name=='nt':
                name += '.exe'
            if os.path.isfile('%s/%s' % (dir, name)):
                return '%s/%s' % (dir,name)
    raise Exception("unable to locate PHP binary, needed to read config file")