hmennen90 / php-steamworks
PHP extension providing access to the Valve Steamworks SDK via a flat C API
Package info
github.com/hmennen90/php-steamworks
Language:C
Type:php-ext
Ext name:ext-steamworks
pkg:composer/hmennen90/php-steamworks
v0.1.1
2026-03-09 20:52 UTC
Requires
- php: >=8.1
README
Native PHP extension providing access to the Steamworks SDK via a flat C API.
Requirements
- PHP 8.1+
- Steamworks SDK 1.58+ (download from partner.steamgames.com)
- macOS (arm64/x86_64), Linux (x86_64), or Windows (x86_64)
Installation
-
Download the Steamworks SDK and extract it to
sdk/in the project root. -
Build the extension:
phpize ./configure --with-steamworks=./sdk make make install
- Enable the extension in
php.ini:
extension=steamworks
See INSTALL.md for detailed platform-specific instructions.
Quick Start
<?php // steam_appid.txt with your App-ID must exist in the working directory if (!steam_init()) { die("Steam not running\n"); } echo "Player: " . steam_friends_get_name() . "\n"; echo "App ID: " . steam_utils_get_app_id() . "\n"; // Game loop while (true) { steam_run_callbacks(); // ... game logic ... usleep(16667); } steam_shutdown();
Available Functions
Core
steam_init(): boolsteam_shutdown(): voidsteam_run_callbacks(): void
User
steam_user_get_steam_id(): int|false
Friends
steam_friends_get_name(): string|falsesteam_friends_set_rich_presence(string $key, ?string $value = null): boolsteam_friends_activate_overlay(string $dialog): void
Stats & Achievements
steam_stats_set_achievement(string $id): boolsteam_stats_clear_achievement(string $id): boolsteam_stats_store(): boolsteam_stats_get_int(string $name): int|falsesteam_stats_set_int(string $name, int $value): boolsteam_stats_get_float(string $name): float|falsesteam_stats_set_float(string $name, float $value): bool
Remote Storage (Cloud Saves)
steam_remote_file_write(string $filename, string $data): boolsteam_remote_file_read(string $filename): string|falsesteam_remote_file_exists(string $filename): boolsteam_remote_file_delete(string $filename): boolsteam_remote_file_list(): array|false
Apps
steam_apps_is_subscribed(): boolsteam_apps_is_dlc_installed(int $dlc_id): boolsteam_apps_get_app_id(): int|falsesteam_apps_get_language(): string|false
Utils
steam_utils_get_app_id(): int|falsesteam_utils_is_overlay_enabled(): boolsteam_utils_get_country_code(): string|false
License
MIT