🚀 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.
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:
- Small business websites
- Landing pages
- Affiliate sites
- Documentation pages
- Simple blogs or article sites
- Domain landing pages
- Local service websites
PhPstrap Lite gives you the benefits of reusable PHP includes while keeping the project simple enough to edit by hand.
2) Requirements
- A web server that supports PHP, such as Apache, LiteSpeed, or Nginx with PHP-FPM.
- PHP 7.4 or newer recommended.
- No MySQL database required.
- No Composer installation required.
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
- Download the latest PhPstrap Lite release from GitHub.
- Unzip the package on your computer.
- Upload the files to your website root, usually
public_html,www, or your domain folder. - Visit your domain in a browser.
- Edit
includes/site-config.phpto 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 = '';
$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 page
<title> - The meta description
- The canonical URL
- Open Graph/social sharing tags, if included in your theme
8) Updating Navigation
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:
/blog/my-article.php— the article content/blog/meta/my-article.php— the article metadata
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'; ?>
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:
- Required fields
- Spam protection
- Cloudflare Turnstile or Google reCAPTCHA
- SMTP delivery
- Custom success and error messages
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:
/aboutinstead of/about.php/contactinstead of/contact.php/blog/sample-articlefor articles
The .htaccess file may also provide:
- HTTPS redirects
- Custom 404 page support
- Basic security headers
- Browser caching rules
- Protection for internal folders
.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:
- Use compressed JPG or WebP images where possible.
- Add useful
alttext. - Avoid uploading very large images directly from a camera or phone.
16) Using Starter Templates
PhPstrap Lite may include starter templates for common website types, such as:
- Business homepage
- Local service homepage
- Affiliate landing page
- Coming soon page
- Simple documentation page
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:
- Update
includes/site-config.php. - Replace placeholder content on each page.
- Upload your images to
/assets/img. - Check your contact form settings.
- Confirm your sitemap URL.
- Upload everything to your hosting account.
- Test the site on desktop and mobile.
Once published, visit important pages such as:
//about/contact/blog/sitemap.php
18) Troubleshooting
Page shows a blank screen
- Check that PHP is enabled on your hosting account.
- Temporarily enable error reporting while testing.
- Check for missing include paths.
Clean URLs do not work
- Confirm your server supports Apache rewrite rules.
- Check that
.htaccesswas uploaded. - Use direct
.phpURLs if needed.
Contact form does not send
- Confirm
$site_emailis set correctly. - Check whether your host supports PHP
mail(). - Use SMTP for more reliable sending.
Images do not load
- Check the file path and filename spelling.
- Remember that Linux servers are case-sensitive.
- Use root-relative paths such as
/assets/img/photo.jpg.
19) Best Practices
- Keep reusable layout code in
/includes. - Keep content sections in
/sections. - Use
custom.cssfor site-specific styling. - Do not edit Bootstrap files directly.
- Keep page titles and descriptions unique.
- Use compressed images for faster loading.
- Test your site on mobile before launch.
- Keep backups before making major changes.
20) Updating PhPstrap Lite
Because PhPstrap Lite is designed to be simple, updates are usually manual.
Before updating:
- Back up your current site.
- Compare changed files from the new release.
- Do not overwrite your customized pages without checking them first.
- Pay special attention to
includes/header.php,includes/footer.php,includes/site-config.php, andassets/css/custom.css.
Need help or want to report an issue? Visit the PhPstrap Lite GitHub repository and open an issue.