Core PHP hosting

Deploy custom PHP websites and applications without a framework. Deploy to a dedicated VPS in seconds — database auto-created, SSL installed, firewall locked down from the first boot.

7.4 – 8.3

Versions

MySQL

Database

PHP

Category

SSL included
Firewall locked
DB auto-created
Live in minutes
Overview

What is Core PHP?

Core PHP is PHP used directly without a full application framework such as Laravel, Symfony or CodeIgniter. It is a flexible choice for custom websites, business portals, admin panels, APIs, internal tools, dashboards, legacy applications and small-to-medium web applications.

A Core PHP application gives developers direct control over the application's files, routing, database queries, authentication, sessions, APIs and server-side logic. You can use PHP's standard libraries and extensions or add third-party packages through Composer without being required to follow a framework-specific application structure.

SharkCluster provides the server environment around your application. You can deploy an existing PHP project, choose the PHP runtime required by the application, configure a domain, connect MySQL, enable HTTPS and manage the application through SSH or the SharkCluster panel.

For production applications, PHP should run behind a production web server such as nginx or Apache with PHP-FPM rather than PHP's built-in development server. PHP's own documentation states that the built-in web server is intended for development and testing, not production use.

Quick facts

Version
7.4 – 8.3
Database
MySQL
Category
PHP
  • SSL included
  • Firewall locked
  • DB auto-created
  • Live in minutes
Why SharkCluster

Why Core PHP on SharkCluster?

Simple PHP deployment

Deploy existing PHP applications without adding a framework or restructuring your project around a specific framework convention.

Multiple PHP versions

Run applications that require different PHP versions when those versions are available on your SharkCluster server. Use supported PHP versions for new production deployments and older versions only when legacy compatibility requires them.

nginx or Apache

Choose a web-server configuration appropriate for your application. PHP can run through PHP-FPM with nginx or Apache.

MySQL ready

Connect your PHP application to a MySQL database and manage database credentials through your application configuration.

Composer support

Use Composer to install and manage PHP packages and dependencies for applications that require third-party libraries.

Full application control

You control your PHP source code, directory structure, configuration, database queries, APIs, authentication and business logic.

Production-ready SSL

Add your domain and enable HTTPS using a free Let's Encrypt certificate.

SSH access

Use SSH to inspect logs, run Composer, execute PHP CLI commands, manage files and troubleshoot your application.

Features

What you get with Core PHP

  • Deploy existing Core PHP applications

  • Multiple PHP runtime versions where supported by the server

  • PHP-FPM process management

  • nginx or Apache web-server configuration

  • MySQL database support

  • Composer pre-installed

  • PHP CLI access

  • Custom document root configuration

  • Custom domain and subdomain support

  • Free Let's Encrypt SSL

  • Environment and configuration file support

  • Cron jobs for scheduled PHP scripts

  • File-manager and SSH deployment

  • Git-based deployment where configured

  • PHP error and server log access

  • Firewall and server-level security controls

  • Application-specific system user

  • Production and development environment support

Use cases

What Core PHP is built for

Business websites

Host custom PHP websites and company portals that do not require a full framework.

Admin dashboards

Deploy custom dashboards for managing customers, products, orders, reports and internal business operations.

REST APIs

Build and host lightweight PHP APIs for web applications, mobile applications and third-party integrations.

Custom CRM and ERP tools

Run custom business applications with PHP, MySQL and scheduled background jobs.

Legacy PHP applications

Host older applications that depend on a specific PHP runtime while planning a migration to a supported version.

Custom portals

Deploy membership portals, customer dashboards, booking systems and other PHP-based applications.

PHP scripts and automation

Run scheduled PHP scripts for reports, imports, exports, notifications and other automated tasks.

System requirements

Server specs for
Core PHP

Not sure which plan to pick? The panel warns you before you deploy so you can choose the right size the first time.

  • Minimum specs shown before deploy
  • Panel blocks deploy if server is undersized
  • Upgrade path available inside the panel
PHP
PHP 8.1+ recommended for modern applications.
Web server
Apache or nginx with PHP-FPM.
Database
MySQL 8.0+.
Dependency manager
Composer 2.x for applications using Composer.
Memory
2 GB RAM minimum; 4 GB+ recommended for production.
CPU
1–2 vCPU for development; 2+ vCPU recommended for production.
Storage
10 GB+ SSD recommended, depending on application files and uploads.
Operating system
Linux recommended for production deployments.
Architecture

How Core PHP fits together

1

Domain

Your domain or subdomain points to the SharkCluster server using DNS.

2

nginx or Apache

The web server receives HTTP/HTTPS requests and serves static files or forwards PHP requests to PHP-FPM.

3

PHP-FPM

PHP-FPM executes PHP application code using the selected PHP runtime.

4

Core PHP application

Your application's PHP files handle routing, business logic, authentication, forms, APIs and other application operations.

5

MySQL

The application can use MySQL to store users, products, orders, configuration and other application data.

6

Composer

Composer manages third-party PHP libraries and project dependencies when your application uses them.

7

Cron

Scheduled PHP scripts can run through server cron for imports, reports, cleanup tasks, notifications and other background operations.

PHP versions

Pick the PHP runtime that fits

Use a supported PHP version

For new production applications, use a PHP branch that is currently supported upstream. PHP follows a four-year lifecycle consisting of active support followed by security-only support.

Legacy PHP versions

Older versions such as PHP 7.4 may still be necessary for legacy applications, but they are no longer supported by the PHP project. Keep legacy applications isolated and plan an upgrade when possible.

Match PHP to your application

Before changing PHP versions, check the application's source code, Composer dependencies, extensions and database library compatibility.

Test before switching

Test PHP version changes on staging first. Older applications may rely on removed functions, changed error behavior or incompatible third-party packages.

Get started

After your Core PHP deploy

  1. 1

    Choose your PHP version

    Select a PHP version compatible with your application. For new projects, prefer a currently supported PHP version.

  2. 2

    Upload or deploy your application

    Deploy your PHP files using Git, ZIP, the file manager or SSH depending on your workflow.

  3. 3

    Set the document root

    Point the domain to the directory containing your application's public entry point, such as index.php.

  4. 4

    Create the database

    Create a MySQL database and database user, then add the generated credentials to your application's configuration.

  5. 5

    Configure environment settings

    Set database credentials, application URL, API keys, mail settings and other environment-specific values required by your application.

  6. 6

    Install Composer dependencies

    If the application uses Composer, run composer install using the project's composer.lock file.

  7. 7

    Configure permissions

    Make sure the web-server user can read application files and has write access only to directories that actually require it.

  8. 8

    Enable HTTPS

    Connect your domain and enable a Let's Encrypt SSL certificate before exposing the application to production traffic.

  9. 9

    Test the application

    Test login, forms, database operations, file uploads, APIs, emails, scheduled tasks and important business workflows before going live.

Deployment

Ship Core PHP your way

Git deployment

Clone or pull your application from a Git repository and run the required dependency installation and deployment commands.

ZIP deployment

Upload a ZIP archive, extract the application into the configured document root and verify ownership and permissions.

File manager deployment

Use the panel's file-management capabilities for smaller applications or individual file changes.

SSH deployment

Developers can use SSH for Composer installation, Git operations, PHP CLI commands, database operations and application troubleshooting.

Scheduled deployment tasks

Use cron for application-specific jobs such as imports, reports, cleanup scripts and recurring API synchronization.

Performance

Keeping Core PHP fast

Use PHP-FPM

PHP-FPM provides a production FastCGI process manager for PHP applications and allows the server to handle multiple PHP requests through managed worker processes.

Enable OPcache

OPcache stores compiled PHP bytecode in shared memory, reducing the need to compile PHP scripts repeatedly.

Choose appropriate PHP-FPM workers

The number of PHP-FPM workers should be based on available RAM, application behavior and expected traffic rather than using an unnecessarily large worker count.

Optimize database queries

Slow MySQL queries can become the main bottleneck in a Core PHP application. Add appropriate indexes and review expensive queries before simply increasing server resources.

Cache expensive operations

Application-level caching can reduce repeated database queries and expensive calculations for frequently requested data.

Optimize uploaded files

Large images, videos and user uploads can consume disk space quickly. Store and process large files carefully and clean unused uploads when appropriate.

Monitor logs and resources

Monitor PHP errors, web-server logs, CPU, RAM, disk usage and database performance to identify bottlenecks before they become outages.

Production checklist

Ready your Core PHP for launch

  • Use a supported PHP version where possible

  • Configure nginx or Apache with PHP-FPM

  • Point the domain to the correct document root

  • Enable HTTPS

  • Disable display_errors in production

  • Enable error logging

  • Configure the correct PHP-FPM service

  • Create a dedicated MySQL database and user

  • Keep database credentials out of publicly accessible files

  • Install Composer dependencies using composer.lock

  • Review file and directory ownership

  • Restrict writable directories

  • Configure application cron jobs

  • Configure SMTP or transactional email

  • Enable server firewall

  • Create application and database backups

  • Remove development files and test scripts

  • Test authentication and authorization

  • Test file uploads

  • Test database operations

  • Test important API endpoints

  • Review PHP and web-server logs

  • Monitor CPU, RAM and disk usage

Useful commands

Working with Core PHP

Check PHP version

Display the PHP CLI version installed for the current command-line environment.

bash
php -v

Check loaded PHP modules

List PHP extensions currently loaded by the CLI binary.

bash
php -m

Check PHP configuration

Show the active PHP configuration file and additional configuration directories.

bash
php --ini

Install Composer dependencies

Install the exact dependencies defined by composer.lock for a production deployment.

bash
composer install --no-dev --optimize-autoloader

Validate PHP syntax

Check a PHP file for syntax errors without executing the application.

bash
php -l index.php

Run a PHP CLI script

Execute a PHP script from the command line. This is useful for imports, maintenance and scheduled tasks.

bash
php script.php

Start local development server

Start PHP's built-in development server for local testing. Do not use it as the production web server.

bash
php -S localhost:8000

Check Composer version

Display the installed Composer version.

bash
composer --version
Troubleshooting

Common Core PHP issues & fixes

PHP source code is displayed in the browser

Cause
The web server is serving the PHP file as a static file instead of passing it to PHP-FPM or the configured PHP handler.
Solution
Check the nginx or Apache PHP handler and verify that the selected PHP-FPM service is running.

502 Bad Gateway

Cause
The web server cannot communicate with PHP-FPM.
Solution
Check the PHP-FPM service, socket path, PHP-FPM logs and web-server configuration.

500 Internal Server Error

Cause
The application may contain a PHP fatal error, invalid configuration or permission problem.
Solution
Check PHP error logs and web-server error logs instead of enabling detailed errors on a production site.

Database connection failed

Cause
Incorrect database credentials, unavailable MySQL service or incorrect hostname/port.
Solution
Verify the database name, username, password, host, port and MySQL service status.

Composer dependency error

Cause
The application's PHP version or required PHP extensions may not match the package requirements.
Solution
Check composer.json, composer.lock, the PHP version and installed extensions before changing dependencies.

File upload does not work

Cause
PHP upload limits, directory permissions or application validation may prevent uploads.
Solution
Check upload_max_filesize, post_max_size, PHP-FPM limits and the writable directory permissions.

Scheduled task is not running

Cause
Cron may be missing, disabled or using a different PHP binary than the application.
Solution
Check the cron entry, command path, PHP binary, working directory and cron logs.

Application is slow

Cause
Slow database queries, excessive PHP processing, insufficient PHP-FPM workers or inefficient application code.
Solution
Review PHP and database performance first, then adjust PHP-FPM resources or VPS capacity based on measured workload.

Permission denied

Cause
Application files or writable directories have incorrect ownership or permissions.
Solution
Review the application system user, web-server user and required writable directories. Avoid making the entire application world-writable.
Security config

Hardened before your first request

Every deploy is locked down from boot — closed firewall, valid SSL, and restricted access by default.

  • Use a currently supported PHP version whenever the application allows it.

  • Do not expose configuration files containing database passwords or API keys through the public document root.

  • Keep production error display disabled and write errors to logs instead. PHP recommends logging errors rather than displaying them on production websites.

  • Use HTTPS for login pages, forms, APIs and the entire production application.

  • Use prepared statements or a safe database abstraction layer instead of concatenating untrusted values into SQL queries.

  • Validate and sanitize user input according to the context in which the data is used.

  • Restrict uploaded files and never execute user-uploaded files as PHP.

  • Use secure password hashing functions such as password_hash() and password_verify().

  • Protect authentication endpoints against brute-force attempts and session abuse.

  • Keep Composer dependencies updated and remove unused packages.

  • Use a dedicated application system user instead of running the website as root.

  • Keep writable directories limited to locations that actually require write access.

  • Use a firewall and expose only the ports required by your application and administration workflow.

  • Keep regular backups of application files and the database.

Database

The data layer behind Core PHP

MySQL connection

Core PHP applications can connect to MySQL using PDO or MySQLi. PDO is commonly preferred when you want a consistent database API and prepared statements.

Database credentials

Keep database credentials outside publicly accessible files whenever possible and use environment-specific configuration.

Prepared statements

Use prepared statements for values supplied by users or external systems to reduce SQL injection risks.

Backups

Back up both application files and database data. A file backup alone is not enough when the database contains the application's important business data.

Cron jobs

Automations that run on schedule

Scheduled imports

Run PHP scripts periodically to import products, customers, orders or data from external systems.

Reports

Generate daily, weekly or monthly reports without requiring users to wait for long-running browser requests.

Cleanup jobs

Remove temporary files, expired sessions, old logs and other data that no longer needs to remain on the server.

API synchronization

Synchronize data with external services on a schedule using a dedicated PHP CLI script.

Notifications

Send scheduled emails or other notifications through background scripts instead of keeping users waiting during web requests.

Security checklist

Lock down Core PHP from day one

  • Use HTTPS

  • Use a supported PHP release

  • Disable display_errors in production

  • Enable PHP error logging

  • Use prepared SQL statements

  • Hash passwords with password_hash()

  • Validate uploaded files

  • Prevent execution of uploaded PHP files

  • Protect sessions and authentication endpoints

  • Keep Composer dependencies updated

  • Remove unused packages and scripts

  • Keep secrets outside the public web root

  • Use least-privilege filesystem permissions

  • Use a dedicated application user

  • Keep backups protected from public access

FAQ

Frequently Asked Questions

The questions we hear most from people deploying Core PHP on SharkCluster.

Contact support

Core PHP means building an application directly with PHP without relying on a full framework such as Laravel or Symfony. It gives developers direct control over application code, routing, database access, sessions, authentication and business logic.

Yes. You can deploy an existing PHP application using Git, ZIP, SSH or file management, then configure its document root, PHP version, database and environment settings.

Use the newest PHP version supported by your application and its dependencies. For new production applications, prefer a currently supported PHP branch. Older versions should generally be used only when legacy application compatibility requires them. PHP's official support schedule should be checked before choosing a runtime.

If SharkCluster provides PHP 7.4 for legacy compatibility, an existing application may still require it. However, PHP 7.4 is end-of-life and no longer receives official security fixes from the PHP project. Upgrade legacy applications to a supported PHP version whenever practical.

Yes. Core PHP applications can use Composer to install packages such as database libraries, HTTP clients, mail libraries, SDKs and other third-party PHP dependencies.

Yes. PHP supports MySQL through extensions such as PDO_MySQL and MySQLi. Use prepared statements and appropriate database permissions when connecting to MySQL.

Yes. Core PHP can be used to build REST APIs and other HTTP endpoints without a framework. You are responsible for implementing routing, authentication, validation, response handling and other API behavior.

Yes. Server cron can execute PHP CLI scripts at scheduled intervals for imports, reports, cleanup, notifications, synchronization and other background tasks.

No. PHP's built-in web server is intended for development and testing and PHP's documentation explicitly warns against using it on public production networks. Use nginx or Apache with PHP-FPM for production.

A 502 commonly means the web server cannot communicate with PHP-FPM. Check whether the correct PHP-FPM service is running and verify that the nginx or Apache configuration points to the correct PHP-FPM socket or FastCGI endpoint.

A 500 error can be caused by a PHP fatal error, invalid configuration, missing extension, application exception or filesystem permission problem. Check the PHP and web-server error logs for the underlying error.

Yes, provided the application and its dependencies support the target PHP version. Always test the application before switching production workloads to a different PHP runtime.

The Core PHP application itself does not require a database, but SharkCluster can provide MySQL for applications that need persistent data such as users, orders, products, settings or reports.

SharkCluster provides and manages the server environment. Your PHP source code, business logic, database schema, custom integrations and application-specific configuration remain under your control.

Yes. Multiple applications can run on the same VPS when the server has enough CPU, RAM and storage. Each application should have its own document root, domain configuration and appropriate filesystem permissions.

One-click setup

From deploy to live in minutes

Stack configured

Runtime, process manager and config files set up for you.

MySQL wired

Database created with a user and credentials in your config.

SSL + firewall

Free Let's Encrypt certificate and closed-by-default UFW rules.

Deploy anytime

Push with Git, or use the built-in file manager and ZIP upload.

Start your journey today

How do you start
with SharkCluster?

To start with SharkCluster, create an account and your first server on DigitalOcean, Contabo or OVHcloud — no credit card or lock-in contract is needed. Every account includes free self-hosted business apps, free local backups, unlimited migrations and a dedicated DevOps manager.

No lock-in contracts
No credit card required
Dedicated DevOps manager