Home / Docs / Getting Started

Getting Started

Learn how to protect your PHP application in under 5 minutes. This guide covers installation, your first license, and encrypting a sample project.

Installation

After purchasing a license, you'll receive a download link via email. The package contains:

Linux / macOS

Extract the archive and make the CLI executable:

bash
# Extract the archive
unzip purephpencryptor-1.0.zip
cd purephpencryptor-1.0

# Make executable
chmod +x ppe

# Optionally, move to your PATH
sudo mv ppe /usr/local/bin/

Windows

Extract the ZIP file and add the folder to your system PATH, or run ppe.exe directly from the extracted folder.

Verify Installation

Run the version command to verify everything is working:

bash
ppe --version
# PurePHPEncryptor v1.0.0

Your First Project

Let's encrypt a simple PHP application. We'll create a sample project, generate a license, encrypt the code, and run it.

Step 1: Create a Sample Project

Create a simple PHP file to encrypt:

php
<?php
// src/hello.php

class SecretAlgorithm
{
    private string $apiKey = 'sk_live_super_secret';

    public function calculate(int $value): int
    {
        // Your proprietary algorithm
        return ($value * 42) + 17;
    }

    public function getApiKey(): string
    {
        return $this->apiKey;
    }
}

$algo = new SecretAlgorithm();
echo "Result: " . $algo->calculate(10) . "\n";

Step 2: Generate a License

Create a license for your development machine. For testing, we'll create a simple license without hardware binding:

bash
ppe license:generate \
    --licensee="Development" \
    --expires=+30d \
    --output=dev.ppe

# Output:
# License created: dev.ppe
# Licensee: Development
# Expires: 2025-02-15

Development vs Production: For development, omit hardware binding. For production licenses, always include --hostname, --ip, or --mac to lock the license to a specific server.

Step 3: Encrypt Your Code

Run the encryptor to transform your source files:

bash
ppe encrypt \
    --license=dev.ppe \
    src/ \
    dist/

# Output:
# Encrypting src/ -> dist/
# [1/1] hello.php
# Runtime bundled: dist/ppe-runtime.php
# Done! Encrypted 1 file.

Step 4: Run Your Encrypted Application

The encrypted files work exactly like the originals:

bash
# Copy the license to the dist folder
cp dev.ppe dist/

# Run the encrypted file
php dist/hello.php

# Output:
# Result: 437

Step 5: Verify Protection

Look at the encrypted file to confirm your code is protected:

bash
cat dist/hello.php

# Output:
# <?php /* PPE:AES256GCM:v1 */
# require_once __DIR__.'/ppe-runtime.php';
# __ppe_exec('K4xV8mPq2nRtYwE9sLkJhGfD...');

Your original source code is now completely hidden. The encrypted blob is only decrypted at runtime, in memory, never written to disk.

What's Next?

Now that you've encrypted your first project, explore these topics:

Licensing

Learn about hardware binding, time limits, and online validation.

Learn more

Encryption Details

Understand how AES-256-GCM encryption protects your code.

Learn more