Host a PHP website
Deploy a PHP site through the APNCloud Hosting Panel. Keep application secrets and private files outside the public directory.
Before you begin
Prepare a site backup, the application’s supported PHP version, required extensions, database export and production configuration. Confirm shell access if Composer must run on the server.
Steps
- Add the domain and confirm its document root in the panel. Use the actual path shown for your account.
- Select a supported PHP version in PHP Settings and check required extensions.
- Upload the application to the correct directory. If it uses a separate public folder, serve only that folder.
- Create a database and a dedicated database user, import the data, and update the application’s private configuration.
- If the project uses Composer, install the locked production dependencies in the application directory. Use the same supported PHP version as the website.
- Enable HTTPS, test the site, and remove any installer, debug page or database export from the public directory.
Composer example
bash
composer install --no-dev --prefer-dist --optimize-autoloaderIf something goes wrong
A 500 error needs the application or PHP error log, not world-writable permissions. Check PHP compatibility, extensions, database credentials and ownership. Disable displayed errors in production; keep private error logging enabled.
Related articles
Last reviewed
2026-10-28
