Websites2 minutes to read

Where can I host a small PHP website cheaply with HTTPS?

Run a PHP site with a public document root and an HTTPS address on Bothosting. What fits on free and paid plans, and how to add your own domain.

A PHP site profile on a small plan

Bothosting’s PHP site profile serves PHP from a dedicated web runtime with a public document root and an HTTPS address. A small PHP site, contact form or simple CMS fits Spark’s 256 MB RAM and 512 MB storage for free, renewed every 7 days. Paid plans start at $2.25 a month, skip renewals. A free Spark site can connect your own domain too.

Keep private files out of the web root

Project layout
public/
  index.php
  contact.php
  style.css
src/
  mailer.php
config.php

Only public/ is served. Keep config.php, includes and anything holding credentials beside it, and load them with a path such as __DIR__ . '/../config.php'. Put passwords and API keys in Variables and read them with getenv().

Publish and test

  1. Choose PHP site under website hosting. Upload the project, or start from the PHP example.
  2. Set MAIN_FILE to public/index.php and start the deployment.
  3. Open the HTTPS address from Settings. Request a second page directly to check that routing works.

Domains, databases and when PHP is not needed

Add a CNAME and a TXT record to connect a hostname such as www.example.com. Free Spark sites can use a custom domain too. See HTTPS and custom domains. For data, a MySQL deployment can share the same account plan. If your site has no server-side code, a static site is lighter. See PHP or static hosting.