php-ssl uses numbered SQL migration files to evolve the database schema incrementally. After every git pull that includes new migration files, you must apply any pending migrations.
Web-facing files moved into public/ and the cron entry point moved to cron/cron.php. When you pull this change on an existing installation:
- Change the web server document root to
<app>/publicand add the/route/rewrite — see Web Server Configuration. nginx installations stop working until this is done. Apache installations keep working through the fallback.htaccessin the application root, but should still be switched. - Update the crontab to
/usr/bin/php <app>/cron/cron.php. The oldcron.phpin the application root has been removed — crontabs still pointing at it will fail. - If PHP
open_basediris set, make sure it covers the application directory, not justpublic/.
Configuration files moved from the application root into config/. After pulling this change, move your local config file:
mv config.php config/config.phpUntil it is moved, the application shows a Configuration file is missing page that names the file to move, and cron jobs fail. config.dist.php is tracked in git and moves automatically. Both the old (/config.php) and new (/config/config.php) locations are listed in .gitignore.
Migrations live in db/migrations/ and are named NNNN_description.sql, for example:
0001_add_changepass_to_users.sql
0002_add_test_to_users.sql
...
Applied migrations are tracked in the migrations database table (by filename). A migration is never applied twice.
A warning banner is shown at the top of every page for admin users when unapplied migrations exist. It links directly to the migration management page.
php db/migrate.php statusOutput:
DB version : 0023_add_testssl_table.sql
Latest : 0030_logs_mediumtext.sql
Pending : 7
Pending migrations:
- 0024_add_notify_email_to_testssl.sql
- 0025_cas_tenant_fk.sql
...
php db/migrate.phpThis applies all pending migrations in order and reports success or failure for each.
Admins can apply individual migrations from the Database Migrations page in the application.
db/SCHEMA.sql is a full dump of the schema and is used by the web installer. After any schema change — whether a new migration file or a direct alteration — regenerate it:
mysqldump --no-data --routines php-ssl > db/SCHEMA.sqlCommit both the migration file and the updated SCHEMA.sql together.
git pull
composer install --no-dev
php db/migrate.phpPHPMailer and Net_DNS2 come from Packagist and can be updated within their version constraints:
composer update --no-dev phpmailer/phpmailer mikepultz/netdns2testssl.sh is pinned to a release tag. To move to a newer one, change the version, dist.url and source.reference of the testssl/testssl.sh package in composer.json (and the matching require constraint), then run composer update --no-dev testssl/testssl.sh. Commit composer.json and composer.lock.
Older versions shipped Net_DNS2, PHPMailer (functions/assets/) and testssl.sh (functions/testSSL/) as git submodules. After pulling, remove the stale submodule checkouts and install with composer:
git submodule deinit -f --all 2>/dev/null
rm -rf functions/assets/Net_DNS2 functions/assets/PHPMailer functions/testSSL .git/modules
composer install --no-devIf cron/cron.php is running, migrations are safe to apply while it runs — each migration is a discrete SQL statement and the cron scripts are tenant-scoped.