{"id":15014429,"url":"https://github.com/xpaw/php-source-query","last_synced_at":"2026-04-04T12:57:57.019Z","repository":{"id":2937545,"uuid":"3949515","full_name":"xPaw/PHP-Source-Query","owner":"xPaw","description":"🐘 PHP library to query servers that implement Steam query protocol (also known as Source Engine Query protocol)","archived":false,"fork":false,"pushed_at":"2024-09-24T20:08:22.000Z","size":288,"stargazers_count":594,"open_issues_count":3,"forks_count":152,"subscribers_count":53,"default_branch":"master","last_synced_at":"2025-05-09T18:18:45.988Z","etag":null,"topics":["php","phpunit","rcon","source-engine","source-games","steam"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/xpaw/php-source-query-class","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xPaw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-04-06T12:46:20.000Z","updated_at":"2025-04-26T07:03:14.000Z","dependencies_parsed_at":"2024-01-14T04:43:10.793Z","dependency_job_id":"3ec7d65b-d12e-4587-9094-a546b232f973","html_url":"https://github.com/xPaw/PHP-Source-Query","commit_stats":{"total_commits":169,"total_committers":19,"mean_commits":8.894736842105264,"dds":0.5502958579881656,"last_synced_commit":"02839815b3281c45b111c8dfdb37d6004d886fe9"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xPaw%2FPHP-Source-Query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xPaw%2FPHP-Source-Query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xPaw%2FPHP-Source-Query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xPaw%2FPHP-Source-Query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xPaw","download_url":"https://codeload.github.com/xPaw/PHP-Source-Query/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270640,"owners_count":22042858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","phpunit","rcon","source-engine","source-games","steam"],"created_at":"2024-09-24T19:45:37.374Z","updated_at":"2026-04-04T12:57:57.009Z","avatar_url":"https://github.com/xPaw.png","language":"PHP","readme":"# PHP Source Query\n\n[![Packagist Downloads](https://img.shields.io/packagist/dt/xpaw/php-source-query-class.svg)](https://packagist.org/packages/xpaw/php-source-query-class)\n[![Packagist Version](https://img.shields.io/packagist/v/xpaw/php-source-query-class.svg)](https://packagist.org/packages/xpaw/php-source-query-class)\n\nThis class was created to query game server which use the Source query protocol, this includes all source games, and all the games that implement Steamworks.\n\nThe class also allows you to query servers using RCON although this only works for half-life 1 and source engine games.\n\n[Minecraft](http://www.minecraft.net) also uses Source RCON protocol, and this means you can use this class to send commands to your minecraft server while having engine set to Source engine.\n\n**:warning: Do not send me emails if this does not work for you, I will not help you.**\n\n## Requirements\n* [Modern PHP version](https://php.net/supported-versions.php)\n* 64-bit PHP or [gmp module](https://secure.php.net/manual/en/book.gmp.php)\n* Your server must allow UDP connections\n\n## Protocol Specifications\n* https://developer.valvesoftware.com/wiki/Server_queries\n* https://developer.valvesoftware.com/wiki/Source_RCON_Protocol\n\n## Supported Games\nAppID | Game | Query | RCON | Notes\n----- | ---- | :---: | :--: | ----\n~ | All HL1/HL2 games and mods | :white_check_mark: | :white_check_mark: | \n10 | [Counter-Strike 1.6](http://store.steampowered.com/app/10/) | :white_check_mark: | :white_check_mark: | \n440 | [Team Fortress 2](http://store.steampowered.com/app/440/) | :white_check_mark: | :white_check_mark: | \n550 | [Left 4 Dead 2](http://store.steampowered.com/app/550/) | :white_check_mark: | :white_check_mark: | \n730 | [Counter-Strike 2](http://store.steampowered.com/app/730/) | :white_check_mark: | :white_check_mark: | `host_name_store 1; host_info_show 2; host_players_show 2`\n1002 | [Rag Doll Kung Fu](http://store.steampowered.com/app/1002/) | :white_check_mark: | :white_check_mark: | \n2400 | [The Ship](http://store.steampowered.com/app/2400/) | :white_check_mark: | :white_check_mark: | \n4000 | [Garry's Mod](http://store.steampowered.com/app/4000/) | :white_check_mark: | :white_check_mark: | \n17710 | [Nuclear Dawn](http://store.steampowered.com/app/17710/) | :white_check_mark: | :white_check_mark: | \n70000 | [Dino D-Day](http://store.steampowered.com/app/70000/) | :white_check_mark: | :white_check_mark: | \n107410 | [Arma 3](http://store.steampowered.com/app/107410/) | :white_check_mark: | :x: | Add +1 to the server port\n115300 | [Call of Duty: Modern Warfare 3](http://store.steampowered.com/app/115300/) | :white_check_mark: | :white_check_mark: | \n162107 | [DeadPoly](https://store.steampowered.com/app/1621070/) | :white_check_mark: | :x: |\n211820 | [Starbound](http://store.steampowered.com/app/211820/) | :white_check_mark: | :white_check_mark: | Call `SetUseOldGetChallengeMethod` method after connecting\n244850 | [Space Engineers](http://store.steampowered.com/app/244850/) | :white_check_mark: | :x: | Add +1 to the server port\n304930 | [Unturned](https://store.steampowered.com/app/304930/) | :white_check_mark: | :x: | Add +1 to the server port\n251570 | [7 Days to Die](http://store.steampowered.com/app/251570) | :white_check_mark: | :x: |\n252490 | [Rust](http://store.steampowered.com/app/252490/) | :white_check_mark: | :x: |\n282440 | [Quake Live](http://store.steampowered.com/app/282440) | :white_check_mark: | :x: | Quake Live uses the ZMQ messaging queue protocol for rcon control.\n346110 | [ARK: Survival Evolved](http://store.steampowered.com/app/346110/) | :white_check_mark: | :white_check_mark: | \n~ | [Minecraft](http://www.minecraft.net/) | :x: | :white_check_mark: | \n108600 | [Project: Zomboid](https://store.steampowered.com/app/108600/) | :white_check_mark: | :white_check_mark: \n1874880 | [Arma Reforger](https://store.steampowered.com/app/1874880/) | :white_check_mark: | :white_check_mark: \n\nOpen a pull request if you know another game which supports Source Query and/or RCON protocols.\n\n## How to tell if the game supports Source Query Protocol?\n\nAdd your server to your favourites in Steam server browser, and if Steam can display information about your server, then the protocol is supported.\n\n## Functions\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eConnect( $Ip, $Port, $Timeout, $Engine )\u003c/td\u003e\n\t\t\u003ctd\u003eOpens connection to a server\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eDisconnect( )\u003c/td\u003e\n\t\t\u003ctd\u003eCloses all open connections\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003ePing( )\u003c/td\u003e\n\t\t\u003ctd\u003ePing the server to see if it exists\u003cbr\u003e\u003cb\u003eWarning:\u003c/b\u003e Source engine may not answer to this\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eGetInfo( )\u003c/td\u003e\n\t\t\u003ctd\u003eReturns server info in an array\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eGetPlayers( )\u003c/td\u003e\n\t\t\u003ctd\u003eReturns players on the server in an array\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eGetRules( )\u003c/td\u003e\n\t\t\u003ctd\u003eReturns public rules \u003ci\u003e(cvars)\u003c/i\u003e in an array\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eSetRconPassword( $Password )\u003c/td\u003e\n\t\t\u003ctd\u003eSets rcon password for later use with \u003ci\u003eRcon()\u003c/i\u003e\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eRcon( $Command )\u003c/td\u003e\n\t\t\u003ctd\u003eExecute rcon command on the server\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\nAlso refer to [examples folder](Examples/) to work things out.\n\n## License\n    PHP Source Query\n    Copyright (C) 2012-2025 Pavel Djundik\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpaw%2Fphp-source-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxpaw%2Fphp-source-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpaw%2Fphp-source-query/lists"}