Fresh Install Guide

Install Payment Processor on a new domain: the in-browser wizard (recommended) or a manual setup.

The quick path: upload the release, point the domain at its public/ folder, then open install.php. The wizard checks the server, creates the database, sets up your admin account, writes .env, shows the cron command for your server, and deletes itself.

Start the install wizard →

1. Prepare the domain and server

2. Requirements

WhatNeeded
PHP8.2 or newer (web and CLI)
MySQL / MariaDB8.0+ / 10.6+
Web serverApache with mod_rewrite (rules are shipped in .htaccess), or Nginx
PHP extensions (required)pdo_mysql, openssl, curl, json, mbstring
PHP extensions (recommended)gd (login captcha), zip (in-app upgrades), fileinfo (upload checks)
PHP functionsputenv() and getenv() must be enabled. aaPanel and some hosts list putenv under disabled functions — remove it there, or every page fails after install.
CronA job that runs every minute

3. Install with the wizard

  1. Upload and extract

    Upload payment-processor-vX.Y.Z.zip to the site folder and extract it so that public/, app/, core/ … sit directly inside the site folder.

    cd /var/www/pay.example.com          # aaPanel: /www/wwwroot/pay.example.com
    unzip payment-processor-vX.Y.Z.zip
    mv payment-processor-vX.Y.Z/* payment-processor-vX.Y.Z/.[!.]* . && rmdir payment-processor-vX.Y.Z

    The zip contains hidden files (.htaccess, .env.example); make sure your file manager copies them too.

  2. Point the document root at public/

    • aaPanel: Website → the site → Site directory → Running directory /public. For Nginx, set URL rewrite to location / { try_files $uri $uri/ /index.php?$query_string; }.
    • cPanel: Domains → the domain → set the document root to …/pay.example.com/public.
    • Nginx / Apache by hand: see Web server config.

    If you can't change the document root, the project root also works on Apache: the shipped root .htaccess routes requests into public/ and blocks the private folders.

  3. Give the web user ownership

    chown -R www:www /www/wwwroot/pay.example.com            # aaPanel (user "www")
    # chown -R www-data:www-data /var/www/pay.example.com    # Debian/Ubuntu
    # cPanel: files are already owned by your account user
    find . -type d -exec chmod 755 {} \;
    find . -type f -exec chmod 644 {} \;

    The wizard writes .env and storage/.installed; later the app writes logs, caches, uploads and upgrade snapshots.

  4. Run the wizard

    Open https://pay.example.com/ — a fresh install redirects to install.php.

    1. Requirements — fix anything red. Amber items are recommended, not blocking.
    2. Database — enter host, port, name, user and password (or a Unix socket). The wizard creates the database if the user may, and refuses a database that already holds an install.
    3. Admin & install — your superadmin name, email and password, and the Application URL: https://pay.example.com, no trailing slash. This becomes APP_URL and is used in every gateway callback and return URL.
    4. Done — shows the cron line for this server and the next steps. The installer has deleted itself.
  5. Activate the license

    Click Activate license on the Done page (or open /install/license) and paste the key. It is bound to the domain shown on that page.

  6. Add the cron job

    Copy the line from the Done page into aaPanel Cron → Shell Script (every minute), cPanel Cron Jobs, or crontab -e:

    * * * * * /usr/bin/php /var/www/pay.example.com/cron/check_pending.php >/dev/null 2>&1

    Use a PHP 8.2+ CLI binary (aaPanel: /www/server/php/82/bin/php; cPanel: /opt/cpanel/ea-php82/root/usr/bin/php). Running it as root is fine — it switches to the owner of storage/.

  7. Log in

    Go to https://pay.example.com/admin/login with the account you created, then continue with After install.

4. Install manually

For scripted deploys, or when the wizard can't run. Do section 1 and the upload and ownership steps above first.

  1. Create the database and import the schema

    mysql -u root -p <<'SQL'
    CREATE DATABASE payment_processor CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    CREATE USER 'pp_user'@'localhost' IDENTIFIED BY 'a-strong-password';
    GRANT ALL PRIVILEGES ON payment_processor.* TO 'pp_user'@'localhost';
    FLUSH PRIVILEGES;
    SQL
    
    mysql -u pp_user -p payment_processor < database/schema.sql
  2. Configure .env

    cp .env.example .env
    # Edit .env:
    #   APP_URL=https://pay.example.com      (public URL, no trailing slash)
    #   APP_DEBUG=false                      (keep off in production)
    #   APP_MODE=production
    #   DB_HOST=127.0.0.1
    #   DB_PORT=3306
    #   DB_NAME=payment_processor
    #   DB_USER=pp_user
    #   DB_PASS=a-strong-password
    #   DB_SOCKET=                           (optional; overrides host/port)
    #   MAIL_*                               (SMTP for payment-link emails)
    chmod 640 .env
  3. Record the migrations

    php bin/migrate.php
    php bin/migrate.php --status     # should end with "(none) — database is up to date"

    schema.sql is already the latest shape; this records the shipped migrations as applied so System Updates starts clean. It is safe to re-run.

  4. Web server config

    Apache

    Enable mod_rewrite and AllowOverride All, and point DocumentRoot at public/. The .htaccess files are shipped.

    Nginx

    server {
        listen 443 ssl http2;
        server_name pay.example.com;
        root /var/www/pay.example.com/public;
        index index.php;
    
        # ssl_certificate / ssl_certificate_key ...
    
        location ~ /\.(env|git|htaccess) { deny all; return 404; }
        location ~ ^/(config|core|app|gateways|database|storage|sdk|cron|vendor)/ {
            deny all; return 404;
        }
    
        location / { try_files $uri $uri/ /index.php?$query_string; }
    
        location ~ \.php$ {
            fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }
    
        client_max_body_size 32M;
    }

    Behind Cloudflare or another proxy, pass X-Forwarded-Proto so the app knows the request was HTTPS.

  5. Mark the install and remove the installer

    Open https://pay.example.com/ once in a browser. With .env in place and admin users in the database, that first request writes storage/.installed (the installed-version marker). Then:

    cat storage/.installed       # confirm it exists
    rm public/install.php
  6. Add the cron job

    * * * * * /usr/bin/php /var/www/pay.example.com/cron/check_pending.php >/dev/null 2>&1

    Test it once by hand: php cron/check_pending.php. A run appears under Cron Logs in the admin.

  7. Activate the license

    In a browser: https://pay.example.com/install/license. Or from the shell (uses the host in APP_URL):

    php bin/license.php activate XXXXX-XXXXX-XXXXX-XXXXX
    php bin/license.php status
  8. Log in and replace the seed account

    A manual install keeps the seed superadmin:

    Email:    [email protected]
    Password: Change@First123
    Log in at /admin/login, create your own superadmin under Admin Users, log in as it, and delete the seed account. At minimum change its password straight away.

5. After install

  1. Check the server

    System Updates → Server configuration checks should be all green (cron running, log folder writable, CLI PHP found).

  2. Set up gateways

    All gateways ship installed and inactive. For each one you use: Payment Gateways → Edit, choose Test or Live mode, enter the credentials, save, then tick Active.

    On the gateway's own dashboard, register the webhook / callback URL where the gateway needs one:

    https://pay.example.com/callback/{slug}      e.g. /callback/paypal, /callback/cashfree
    • PayPal, Razorpay and Cashfree need a webhook; PayU is recommended; Atom and PayGlocal are optional.
    • Cashfree: also whitelist the domain (Developers → Whitelisting → Payment Gateway) or its checkout won't load.
    • Return URLs (/return/{slug}/{txn}) are sent with each payment — don't register them by hand.

    The Edit page of each gateway shows its exact URLs and setup notes.

  3. Add merchants and hand over the SDK

    Merchants → Add: name, code, return URL, callback (webhook) URL, and the gateways it may use. Then Integrations → the merchant → Download SDK bundle. The bundle holds the SDK, the integration guide, an example and a config.php with the credentials and this domain as the endpoint.

  4. Optional settings

    • Settings → General: timezone, currency, checkout window, refund mode.
    • Settings → Branding: site logo, icon and favicon.
    • Settings → Themes: admin colour theme (gradient or flat; every theme has light and dark).
    • Settings → Login Security: Cloudflare Turnstile keys (add this domain as a hostname on the widget), which check shows first, and on/off for each. The built-in captcha is on by default.
    • .env: MAIL_* for emails. TURNSTILE_SITE_KEY / TURNSTILE_SECRET_KEY still work; keys saved in Login Security take priority.
    • System Health (sidebar): checks cron, email, file permissions and that the web server blocks private files. Open it once after installing.
  5. Smoke test

    • With a gateway in Test mode, start a payment from a test merchant (SDK example.php or a payment link).
    • Confirm it reaches the gateway, returns to the merchant's return URL, and the transaction ends success with a webhook logged.
    All passing? Switch the gateway to Live and you're done.

6. Moving an existing install to a new domain

  1. Back up

    Dump the database and copy the whole install folder, including .env, uploads/, public/uploads/ and storage/.

    mysqldump -u pp_user -p --single-transaction payment_processor > pp-backup.sql
    tar czf pp-files.tgz -C /var/www pay.example.com
  2. Release the license on the old domain

    php bin/license.php deactivate      # run on the old install

    If the old server is gone, ask your vendor to release the seat.

  3. Restore on the new server

    Do section 1, restore the files and the database, then:

    # .env
    APP_URL=https://pay.new-domain.com
    DB_...=                                  # new database credentials, if they changed
    
    rm -f config/license.php                 # bound to the old domain
    rm -f public/install.php                 # never run the wizard over a restored database
    php bin/migrate.php --status             # should show nothing pending

    Then fix ownership, point the document root at public/, and add the cron job (paths may differ on the new server).

  4. Activate on the new domain

    Open https://pay.new-domain.com/install/license, or run php bin/license.php activate <key>.

  5. Update the gateways

    On every gateway dashboard, replace the old domain in webhook / callback URLs with https://pay.new-domain.com/callback/{slug}, and update Cashfree's domain whitelist. Nothing to change inside the admin: return URLs follow APP_URL.

  6. Tell merchants the new endpoint

    Each merchant changes setEndpoint('https://pay.new-domain.com') (or re-downloads the SDK bundle from Integrations). API keys and secrets don't change. The SDK doesn't follow redirects, so an old endpoint fails until it is updated.

  7. Keep the old domain redirecting

    Redirect the old domain to the new one with a 308 (keeps POST bodies) for at least a day, so customers and gateway callbacks for payments started before the move still arrive.

    # Nginx, old domain
    return 308 https://pay.new-domain.com$request_uri;

    Also update the Turnstile widget hostname and the mail sender domain if you use them.

7. Troubleshooting

SymptomFix
"Internal Server Error" or blank page on every URL right after install putenv is disabled — remove it from PHP's disabled functions and reload PHP.
404 on everything except the home page Apache: enable mod_rewrite and AllowOverride All. Nginx: add the try_files … /index.php?$query_string rule.
Admin pages have no styling The document root isn't public/ and the root .htaccess wasn't uploaded (hidden file).
Every page redirects to /install/license The license isn't activated for this domain yet.
Gateway callbacks never arrive / URLs show http:// APP_URL in .env must be the public https:// address.
Logo upload fails Give the web user write access to public/uploads/ (or uploads/ when the project root is the document root).
Payments stay pending forever The cron isn't running — check Cron Logs and the cron's PHP path.
Wizard says the database already contains an install Use an empty database, or log in and upgrade via System Updates instead.

What goes where

PathWhat it holdsPreserved by upgrade?
.envEnvironment + DB credentialsYes
config/license.phpLicense activation (bound to one domain)Yes
storage/logs/Daily app + cron logsYes
storage/backups/Pre-upgrade snapshotsYes
storage/.installedInstalled-version markerYes
uploads/, public/uploads/Merchant logos, gateway icons, brandingYes
Everything elseSource code, templates, migrationsOverwritten on upgrade

Help