🚀 Getting Started with PhPstrap Lite

This guide explains how to install PhPstrap Lite, configure your site, edit pages, add blog posts, customize sections, and publish your site.

TL;DR: Upload the files to your web server, edit includes/site-config.php, customize the pages, and publish. No database or installer is required.

1) What is PhPstrap Lite?

PhPstrap Lite is a lightweight PHP and Bootstrap starter kit for building simple static-style websites without a database, admin panel, or complicated CMS setup.

It is ideal for:

PhPstrap Lite gives you the benefits of reusable PHP includes while keeping the project simple enough to edit by hand.


2) Requirements

Good news: PhPstrap Lite is designed to run on most shared hosting accounts.

3) File Structure

A typical PhPstrap Lite install includes a structure similar to this:

/index.php
/about.php
/contact.php
/privacy.php
/terms.php
/404.php

/includes/
  header.php
  footer.php
  nav.php
  site-config.php

/sections/
  hero.php
  features.php
  pricing.php
  faqs.php
  testimonials.php
  cta.php

/blog/
  sample-article.php

/blog/meta/
  sample-article.php

/scripts/
  send-contact.php

/assets/
  css/
  js/
  img/

.htaccess
robots.txt
sitemap.php
README.md

The main pages live in the root directory. Shared layout files live in /includes. Reusable content blocks live in /sections. Blog posts and article metadata live in /blog.


4) Installation

  1. Download the latest PhPstrap Lite release from GitHub.
  2. Unzip the package on your computer.
  3. Upload the files to your website root, usually public_html, www, or your domain folder.
  4. Visit your domain in a browser.
  5. Edit includes/site-config.php to update your site name, URL, email, and theme options.

No database import, installer, or admin setup is needed.


5) Configure Your Site

Most global settings are managed in:

/includes/site-config.php

Use this file to control the site name, URL, description, contact email, logo, theme options, and analytics settings.

<?php
$site_name = 'PhPstrap Lite';
$site_url = 'https://example.com';
$site_description = 'A lightweight PHP and Bootstrap static site starter.';
$site_email = 'hello@example.com';

$site_logo = '/assets/img/logo.png';

$enable_dark_mode = true;
$enable_ads = false;

$google_analytics_id = '';
Important: Update $site_url to your real domain before launching. This helps canonical URLs, sitemap links, and SEO metadata work correctly.

6) Editing Pages

Each page is a normal PHP file. For example, about.php may define its page title and description before loading the shared header.

<?php
$page_title = 'About Us';
$page_description = 'Learn more about our website.';
$page_slug = 'about';

include 'includes/header.php';
?>

<section class="py-5">
  <div class="container">
    <h1>About Us</h1>
    <p>This is where your page content goes.</p>
  </div>
</section>

<?php include 'includes/footer.php'; ?>

This approach keeps each page simple while still allowing global navigation, footer, scripts, and SEO tags to be reused across the site.


7) Page Titles and SEO Meta

PhPstrap Lite supports per-page SEO values using simple variables.

<?php
$page_title = 'Contact Us';
$page_description = 'Contact our team for questions, support, or project inquiries.';
$page_slug = 'contact';

The shared header can then use those values to generate:


The main navigation is usually located at:

/includes/nav.php

Edit this file to add, remove, or rename menu links.

<ul class="navbar-nav ms-auto">
  <li class="nav-item">
    <a class="nav-link" href="/">Home</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="/about">About</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="/blog">Blog</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="/contact">Contact</a>
  </li>
</ul>

If your server does not support clean URLs, use direct PHP links such as /about.php instead of /about.


9) Using Reusable Sections

Reusable sections are stored in:

/sections/

These are optional Bootstrap content blocks that can be included on any page.

<?php include 'sections/hero.php'; ?>
<?php include 'sections/features.php'; ?>
<?php include 'sections/cta.php'; ?>

This makes it easy to build new landing pages quickly without rewriting the same layout code every time.


10) Adding Blog Posts or Articles

PhPstrap Lite can support a simple flat-file blog without a database.

A blog post usually has two files:

Create the metadata file

<?php
return [
  'title' => 'My First PhPstrap Lite Article',
  'slug' => 'my-first-phpstrap-lite-article',
  'date' => '2026-05-09',
  'excerpt' => 'A simple example article built with PhPstrap Lite.',
  'cover_image' => '/assets/img/sample.jpg',
  'tags' => ['PhPstrap Lite', 'PHP', 'Bootstrap'],
];

Create the article file

<?php
$page_title = 'My First PhPstrap Lite Article';
$page_description = 'A simple example article built with PhPstrap Lite.';
$page_slug = 'my-first-phpstrap-lite-article';

include '../includes/header.php';
?>

<article class="py-5">
  <div class="container">
    <h1>My First PhPstrap Lite Article</h1>
    <p class="lead">This is a sample article introduction.</p>

    <p>Write your article content here.</p>
  </div>
</article>

<?php include '../includes/footer.php'; ?>
Tip: Keep article slugs lowercase and use hyphens, such as moving-checklist or best-email-hosting-guide.

11) Contact Form

PhPstrap Lite can include a basic PHP contact form using:

/contact.php
/scripts/send-contact.php

Update your destination email in includes/site-config.php:

$site_email = 'hello@example.com';

The contact script can be customized to add:

Note: Basic PHP mail() may not work reliably on every host. For production contact forms, SMTP is usually more reliable.

12) Clean URLs and .htaccess

PhPstrap Lite may include an optional .htaccess file for Apache-compatible servers.

This can enable clean URLs such as:

The .htaccess file may also provide:

If clean URLs do not work: Your server may not support .htaccess or mod_rewrite. You can still use direct URLs such as /about.php.

13) Sitemap and Robots.txt

PhPstrap Lite includes basic search engine files:

/sitemap.php
/robots.txt

Before launch, check that your sitemap uses the correct domain from $site_url in site-config.php.

Your robots.txt file should point to your sitemap:

User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.php

Replace https://example.com with your real website URL.


14) Custom CSS and JavaScript

Custom styles are usually placed in:

/assets/css/custom.css

Custom JavaScript can be placed in:

/assets/js/main.js

Use these files for site-specific changes instead of editing Bootstrap directly.

.hero-section {
  padding: 5rem 0;
}

.site-footer {
  margin-top: 4rem;
}

15) Adding Images

Place images in:

/assets/img/

Then reference them like this:

<img src="/assets/img/example.jpg" alt="Example image" class="img-fluid rounded">

For best performance:


16) Using Starter Templates

PhPstrap Lite may include starter templates for common website types, such as:

Templates are usually stored in:

/templates/

You can copy a template into a new page, rename it, and customize the content.


17) Publishing Your Site

To publish your PhPstrap Lite website:

  1. Update includes/site-config.php.
  2. Replace placeholder content on each page.
  3. Upload your images to /assets/img.
  4. Check your contact form settings.
  5. Confirm your sitemap URL.
  6. Upload everything to your hosting account.
  7. Test the site on desktop and mobile.

Once published, visit important pages such as:


18) Troubleshooting

Page shows a blank screen

Clean URLs do not work

Contact form does not send

Images do not load


19) Best Practices


20) Updating PhPstrap Lite

Because PhPstrap Lite is designed to be simple, updates are usually manual.

Before updating:

Recommended workflow: Keep your customized site in a Git repository so you can compare changes and roll back if needed.

Need help or want to report an issue? Visit the PhPstrap Lite GitHub repository and open an issue.