Complete configuration guide for the Bearsampp Module PHP Gradle build system.
- Configuration Files
- Build Properties
- Gradle Properties
- PHP Version Configuration
- Extension Configuration
- PEAR Configuration
- Dependency Configuration
- Environment Variables
| File | Purpose | Format | Location |
|---|---|---|---|
build.properties |
Main build configuration | Properties | Root |
gradle.properties |
Gradle-specific settings | Properties | Root |
settings.gradle |
Gradle project settings | Groovy | Root |
build.gradle |
Main build script | Groovy | Root |
releases.properties |
Available PHP releases | Properties | Root |
exts.properties |
PHP extensions per version | Properties | bin/php{ver}/ |
pear.properties |
PEAR configuration per version | Properties | bin/php{ver}/ |
deps.properties |
Dependencies per version | Properties | bin/php{ver}/ |
Location: E:/Bearsampp-development/module-php/build.properties
Purpose: Main build configuration for the PHP module
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
bundle.name |
String | Yes | php |
Name of the bundle |
bundle.release |
String | Yes | - | Release version (YYYY.MM.DD) |
bundle.type |
String | Yes | bins |
Type of bundle |
bundle.format |
String | Yes | 7z |
Archive format for output |
bundle.name = php
bundle.release = 2025.10.31
bundle.type = bins
bundle.format = 7zdef buildProps = new Properties()
file('build.properties').withInputStream { buildProps.load(it) }
def bundleName = buildProps.getProperty('bundle.name', 'php')
def bundleRelease = buildProps.getProperty('bundle.release', '1.0.0')Location: E:/Bearsampp-development/module-php/gradle.properties
Purpose: Gradle-specific configuration and JVM settings
| Property | Type | Default | Description |
|---|---|---|---|
org.gradle.daemon |
Boolean | true |
Enable Gradle daemon |
org.gradle.parallel |
Boolean | true |
Enable parallel task execution |
org.gradle.caching |
Boolean | true |
Enable build caching |
org.gradle.jvmargs |
String | - | JVM arguments for Gradle |
org.gradle.configureondemand |
Boolean | false |
Configure projects on demand |
# Gradle daemon configuration
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.caching=true
# JVM settings
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError
# Configure on demand
org.gradle.configureondemand=false| Setting | Recommended Value | Purpose |
|---|---|---|
org.gradle.daemon |
true |
Faster builds with daemon |
org.gradle.parallel |
true |
Parallel task execution |
org.gradle.caching |
true |
Cache task outputs |
org.gradle.jvmargs |
-Xmx2g |
Allocate 2GB heap for Gradle |
Each PHP version has its own directory in bin/:
bin/
βββ php8.1.32/
β βββ exts.properties
β βββ pear.properties
β βββ deps.properties
β βββ php.ini
βββ php8.3.15/
β βββ exts.properties
β βββ pear.properties
β βββ deps.properties
β βββ php.ini
βββ php8.4.14/
βββ exts.properties
βββ pear.properties
βββ deps.properties
βββ php.ini
| Pattern | Example | Description |
|---|---|---|
php{major}.{minor}.{patch} |
php8.3.15 |
Standard PHP version format |
Location: bin/php{version}/exts.properties
Purpose: Define PHP extensions to include in the build
phpexts.{extension_name}={download_url}phpexts.imagick=https://windows.php.net/downloads/pecl/releases/imagick/3.7.0/php_imagick-3.7.0-8.3-ts-vs16-x64.zip
phpexts.redis=https://windows.php.net/downloads/pecl/releases/redis/6.0.2/php_redis-6.0.2-8.3-ts-vs16-x64.zip
phpexts.xdebug=https://xdebug.org/files/php_xdebug-3.3.1-8.3-vs16-x86_64.dll
phpexts.opcache=https://windows.php.net/downloads/pecl/releases/opcache/8.3.15/php_opcache-8.3.15-ts-vs16-x64.zip| Property | Type | Required | Description |
|---|---|---|---|
phpexts.{name} |
URL | Yes | Download URL for extension |
| Format | Description | Example |
|---|---|---|
.zip |
ZIP archive containing DLL | php_redis-6.0.2-8.3-ts-vs16-x64.zip |
.dll |
Direct DLL file | php_xdebug-3.3.1-8.3-vs16-x86_64.dll |
- Download: Extension is downloaded from the specified URL
- Extract: If ZIP, extract to temporary directory
- Validate: Check DLL is 64-bit architecture
- Copy: Copy
php_{name}.dlltoext/directory - Configure: Add
extension={name}tophp.ini(except xdebug)
| Extension | Special Handling |
|---|---|
imagick |
Copies CORE_*.dll files to imagick/ directory |
xdebug |
Not added to extension= list in php.ini |
Location: bin/php{version}/pear.properties
Purpose: Configure PEAR installation for the PHP version
phppear.pear={pear_phar_url}phppear.pear=https://pear.php.net/install-pear-nozlib.phar| Property | Type | Required | Description |
|---|---|---|---|
phppear.pear |
URL | Yes | URL to PEAR installation phar |
- Copy Scripts: Copy
pear-install.batandpear-install.phpto temp directory - Download: Download PEAR phar from specified URL
- Rename: Rename to
install-pear-nozlib.phar - Execute: Run
pear-install.batto install PEAR - Cleanup: Remove temporary installation files
Location: bin/php{version}/deps.properties
Purpose: Define external dependencies required by PHP extensions
phpdeps.{dependency_name}={download_url}phpdeps.imagemagick=https://imagemagick.org/archive/binaries/ImageMagick-7.1.1-28-portable-Q16-HDRI-x64.zip| Property | Type | Required | Description |
|---|---|---|---|
phpdeps.{name} |
URL | Yes | Download URL for dependency |
| Dependency | Purpose | Target Directory |
|---|---|---|
imagemagick |
Image processing for imagick ext | imagick/ |
- Download: Dependency is downloaded from the specified URL
- Extract: If archive, extract to temporary directory
- Copy: Copy required files to target directory
- Validate: Ensure all required files are present
| Variable | Description | Example |
|---|---|---|
JAVA_HOME |
Java installation directory | C:\Program Files\Java\jdk-11 |
GRADLE_HOME |
Gradle installation directory | C:\Gradle\gradle-8.5 |
PATH |
System path (includes Java, Gradle) | - |
| Variable | Description | Default |
|---|---|---|
GRADLE_USER_HOME |
Gradle user home directory | ~/.gradle |
GRADLE_OPTS |
Additional Gradle JVM options | - |
build.properties:
bundle.name = php
bundle.release = 2025.10.31
bundle.type = bins
bundle.format = 7zbin/php8.3.15/exts.properties:
phpexts.redis=https://windows.php.net/downloads/pecl/releases/redis/6.0.2/php_redis-6.0.2-8.3-ts-vs16-x64.zip
phpexts.xdebug=https://xdebug.org/files/php_xdebug-3.3.1-8.3-vs16-x86_64.dllbin/php8.3.15/pear.properties:
phppear.pear=https://pear.php.net/install-pear-nozlib.pharbin/php8.4.14/exts.properties:
phpexts.imagick=https://windows.php.net/downloads/pecl/releases/imagick/3.7.0/php_imagick-3.7.0-8.4-ts-vs16-x64.zip
phpexts.redis=https://windows.php.net/downloads/pecl/releases/redis/6.0.2/php_redis-6.0.2-8.4-ts-vs16-x64.zipbin/php8.4.14/deps.properties:
phpdeps.imagemagick=https://imagemagick.org/archive/binaries/ImageMagick-7.1.1-28-portable-Q16-HDRI-x64.zipbin/php8.1.32/exts.properties:
# No extensions configuredbin/php8.1.32/pear.properties:
phppear.pear=https://pear.php.net/install-pear-nozlib.phar# Validate build.properties
gradle validateProperties
# Verify entire environment
gradle verify
# List configured extensions
gradle listExtensions
# List configured PEAR
gradle listPearConfig
# List configured dependencies
gradle listDependencies| Item | Command | Expected Result |
|---|---|---|
| Build properties | gradle validateProperties |
All required properties set |
| Environment | gradle verify |
All checks pass |
| Extensions | gradle listExtensions |
Extensions listed |
| PEAR | gradle listPearConfig |
PEAR config listed |
| Dependencies | gradle listDependencies |
Dependencies listed |
- Version Control: Keep all
.propertiesfiles in version control - Documentation: Document custom configurations
- Validation: Always run
gradle verifyafter configuration changes - Testing: Test builds with new configurations before committing
- Backup: Keep backups of working configurations
- 64-bit Only: Always use 64-bit extensions
- Version Matching: Match extension version to PHP version
- Thread Safety: Use thread-safe (TS) extensions
- Compiler: Match Visual Studio compiler version (vs16)
- Testing: Test extensions after adding to configuration
- Gradle Daemon: Enable for faster builds
- Parallel Execution: Enable for multi-core systems
- Build Cache: Enable for incremental builds
- JVM Heap: Allocate sufficient memory (2GB+)
- Network: Use fast, reliable network for downloads
Last Updated: 2025-01-31
Version: 2025.10.31