1. Download and upload
Order a license or start a free trial at https://control-webpanel.com/cwp-billing. The download link is in your client area.
Unpack the package on the server as the account user, for example to /home/user/billing/:
cd /home/user
unzip cwp-billing-v1.xx.zip -d billing
The best setup is to point the web root (document root) of the billing domain to the public/ folder. Then only public/ can be reached from the web.
If you cannot change the web root (shared hosting), unpack into the web root itself. The included .htaccess then serves public/ and blocks everything else (Apache or LiteSpeed with mod_rewrite).
Permissions. The web server user must be able to write:
config/, during the installation only;storage/;public/themes/.
On CWP, cPanel and any server with suPHP or suexec, keep folders at 755 and files at 644. The package comes like this. PHP files that the group or others can write to are refused with HTTP 500 (“writeable by group”). This command fixes them:
find /home/user/billing -perm /022 -exec chmod go-w {} +
On CWP, the account’s public_html must stay user:nobody with mode 750. Otherwise Apache cannot read .htaccess and returns HTTP 403.
2. Database
Create an empty MySQL or MariaDB database (utf8mb4) and a user with all privileges on it.
3. Installer
Open the domain in a browser. The installer checks the server first (PHP version, extensions, ionCube, writable folders, file permissions), then asks for:
- License key. Leave it empty for the free trial. The billing then works with all features for 15 days on this domain.
- Billing address (URL), company name, time zone and the secret admin path. Staff log in at
https://billing.example.com/<admin path>/. Choose something that cannot be guessed. - Database: host, name, user and password.
- First administrator: user name, e-mail and password.
The installer creates the tables, writes config/config.php and then disables itself. Afterwards you can make config/ read-only:
chmod 750 config; chmod 600 config/config.php
Without a browser:
php bin/console install --url=https://billing.example.com --db-name=billing --db-user=billing --db-pass=... \
--admin-email=you@example.com [--license=KEY]
Without --license, the installation starts a free trial.
4. Cron (required)
*/5 * * * * php /home/user/billing/bin/console cron
* * * * * php /home/user/billing/bin/console massmail:send
Use the same PHP version as the web server. On CWP that is for example /opt/alt/php-fpm83/usr/bin/php.
The 5-minute cron runs the following:
- payments and webhooks that wait for processing;
- e-mail piping retries;
- status page checks and the security monitor;
- once a day, at the hour set in Billing settings, the daily billing run.
5. Web server
Apache / LiteSpeed: no changes needed (public/.htaccess).
nginx:
root /home/user/billing/public;
index index.php;
location / { try_files $uri /index.php$is_args$args; }
location ~ ^/index\.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param HTTP_AUTHORIZATION $http_authorization;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
}
location ~ \.php$ { return 404; }
Behind a proxy (nginx in front of Apache, a CDN, a load balancer): add the proxy’s addresses to trusted_proxies in config/config.php. The installer already adds the server’s own IPs. Without this, all visitors appear with the proxy IP, and staff sessions can end at once, because they are bound to the IP.
Attachments up to 20 MB: set upload_max_filesize = 20M and post_max_size = 25M. The included public/.user.ini does this for PHP-FPM.
6. E-mail piping (tickets by e-mail)
Forward each support address to pipe.php, for example as an alias in Postfix:
support: "|php -q /home/user/billing/pipe.php"
The recipient address chooses the department (Departments → e-mail). The billing recognises replies by [Ticket ID: …] in the subject. More details are in Support desk.
Next
Continue with First steps.