{"record":{"id":"dc562c3dd30a789b","repo":"oraios/serena","slug":"phpantom-lsp-executable-not-found-at-binary-path","errorCode":null,"errorMessage":"phpantom_lsp executable not found at {binary_path}","messagePattern":"phpantom_lsp executable not found at (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/phpantom.py","lineNumber":155,"sourceCode":"            system_phpantom = shutil.which(\"phpantom_lsp\")\n            if system_phpantom is not None:\n                log.info(f\"Using system-installed phpantom_lsp at {system_phpantom}\")\n                return system_phpantom\n\n            # resolving the bundled binary\n            phpantom_version = self._custom_settings.get(\"phpantom_version\", DEFAULT_PHPANTOM_VERSION)\n            dependencies = _create_phpantom_dependencies(phpantom_version)\n            binary_dirname = \"phpantom-lsp\" if phpantom_version == INITIAL_PHPANTOM_VERSION else f\"phpantom-lsp-{phpantom_version}\"\n            binary_dir = os.path.join(self._ls_resources_dir, binary_dirname)\n            binary_path = dependencies.binary_path(binary_dir)\n            if not os.path.exists(binary_path):\n                os.makedirs(binary_dir, exist_ok=True)\n                dep = dependencies.get_single_dep_for_current_platform(\"phpantom_lsp\")\n                log.info(f\"Downloading phpantom_lsp from {dep.url}\")\n                dependencies.install(binary_dir)\n\n            if not os.path.exists(binary_path):\n                raise FileNotFoundError(f\"phpantom_lsp executable not found at {binary_path}\")\n\n            if PlatformUtils.get_platform_id() not in (PlatformId.WIN_x64, PlatformId.WIN_arm64):\n                current_mode = os.stat(binary_path).st_mode\n                os.chmod(binary_path, current_mode | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)\n\n            return binary_path\n\n        def _create_launch_command(self, core_path: str) -> list[str]:\n            return [core_path, \"--stdio\"]\n\n    def __init__(self, config: LanguageServerConfig, repository_root_path: str, solidlsp_settings: SolidLSPSettings):\n        super().__init__(config, repository_root_path, None, \"php\", solidlsp_settings)\n        self._ignored_dirnames = {\"node_modules\", \"cache\"}\n        if self._custom_settings.get(\"ignore_vendor\", True):\n            self._ignored_dirnames.add(\"vendor\")\n        log.info(f\"Ignoring the following directories for PHP (PHPantom): {', '.join(sorted(self._ignored_dirnames))}\")\n\n    def _create_dependency_provider(self) -> LanguageServerDependencyProvider:","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/phpantom.py#L137-L173","documentation":"After resolving (and, if missing, downloading) the pinned phpantom_lsp archive, the dependency provider re-checks that the binary actually exists at the expected binary_path. If the executable is still absent — the download/extraction did not produce the expected binary — this FileNotFoundError is raised. It is a post-install integrity check that the archive contained the binary named by the RuntimeDependency.","triggerScenarios":"Calling SolidLanguageServer.create for PHP without phpantom_lsp on PATH, where dependencies.install() ran but the binary did not appear at binary_path — e.g. the archive layout changed, the download was interrupted but a partial dir was cached, the disk was full, or a previous failed install left binary_dir without the executable so the 'if not os.path.exists' re-download was skipped.","commonSituations":"Corrupt or partial earlier download cached in the ls resources dir; platform mismatch where get_single_dep_for_current_platform found no matching dep so nothing was installed; proxy/network failure during dependencies.install; extraction skipped because a stale binary_dir already existed.","solutions":["Delete the cached install directory (…/ls_resources/phpantom-lsp-0.8.0 or phpantom-lsp) and let Serena re-download.","Check logs just above the error for the download URL and any extraction/network errors during dependencies.install.","Verify network access to github.com and release-assets.githubusercontent.com (corporate proxies commonly block these).","Install phpantom_lsp manually and make it available on PATH so the bundled install path is skipped.","Check free disk space and that the resources directory is writable."],"exampleFix":"rm -rf ~/.cache/serena/language_servers/static/phpantom-lsp-0.8.0   # then re-run; forces a clean download","handlingStrategy":"try-catch","validationCode":"import shutil\nif shutil.which('phpantom_lsp') is None:\n    # bundled path will download; ensure resources dir is writable and GitHub reachable\n    import urllib.request\n    urllib.request.urlopen('https://github.com/PHPantom-dev/phpantom_lsp/releases', timeout=10)","typeGuard":null,"tryCatchPattern":"try:\n    server = SolidLanguageServer.create('php', repo_root, settings)\nexcept FileNotFoundError as e:\n    if 'phpantom_lsp executable not found' in str(e):\n        shutil.rmtree(Path(settings['ls_resources_dir']) / 'phpantom-lsp-0.8.0', ignore_errors=True)\n        server = SolidLanguageServer.create('php', repo_root, settings)  # clean re-download\n    else:\n        raise","preventionTips":["Ensure github.com and release-assets.githubusercontent.com are reachable (proxy/firewall allowlist).","Clear stale/partial phpantom-lsp-* resource dirs after interrupted installs.","Keep enough disk space and write permissions in the ls resources directory.","Or pre-install phpantom_lsp on PATH to skip the download path entirely."],"tags":["python","download","language-server","missing-binary"],"backgroundTag":"executable-not-found","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}