Composite, simplest static site generator
The simplest static site generator to create a website and then put it online. Free, open-source.

Composite is a PHP script that performs all page composition tasks locally before transferring them to the server, where they function as simple HTML pages.
This primarily allows for the reuse of the same header and footer, with PHP variables assigned to each page based on its content.
For example, the title and description of articles are assigned to each page and are inserted by Composite into the header when the page is published.
Case of PHP files interacting with the server
PHP files that are called by website pages, for example, to access or modify a database, should not be treated like static pages. There are two ways to distinguish between them:
1) By extension.
By default, the script composes pages with the HTML extension (which you can change). Therefore, PHP pages that need to run on the server (or other server-side languages) will be transferred directly without local execution.
Only pages with the HTML extension are executed locally, unless you have chosen a different extension.
2) With a separate directory
For example, you can place the website pages in example.com and the executable files on the server in example.php.
The contents of the example.com directory will be uploaded by Composite.
The contents of the example.php directory can be uploaded by Composite with the -u option, or with FTP Synchronizer.
Composite only transfers modified or new files to the local directory. On first use or with the -a option, all files are transferred.
The files transferred by Composite to the server are also copied to a backup directory (in their original state before code execution). The program compares each file in the local directory with the backup directory and thus determines which ones have been modified.
Manual
The following command will compose the pages contained in the local directory example.com and transfer them via FTP to the server:
php composite.php -lxxxxx -pxxxx c:\example.com -fxxxx -dexample.com/ -bd:\example.com -wexample.com %1
It is best to put the command in a batch file; on Windows, this could be:
example.bat
The %1 option in the command allows you to add extra parameters if needed, such as -t for a preliminary test.
example.bat -t
Parameters and options:
- -1 login, FTP username.
- -p password.
- Name of the local directory where the pages and resources to be uploaded are stored.
- -f FTP address, address on the server (an IP address or in the form ftp.xxx).
- -d remote directory on the hosting server. This could be "/", "htdocs", "www", or another directory.
- -b backup directory used to compare pages with previously transferred pages.
- -w website URL.
- -o extension, to replace the default page extension, which is HTML.
- -r extension, for the extension of the uploaded page. By default, the extension is unchanged.
- -a transfers all files. Followed by an extension, transfers all files with that extension.
Multiple -aext parameters can be used to transfer multiple extensions. - -u unchanged, transfers files without executing the code locally.
- -t test only; nothing is sent to the server, but displays what will be done.
- -s speeds up by omitting the link validity test within the pages.
Useful when pages have been modified without changing the links they contain. - -v verbose, displays more information about what is being done.
- -q quiet, displays nothing.
Example of template
In this example, we have a header.html and footer.html file that are common to all pages of the site.
Each page contains PHP variables used by these two files to fill the tags.
header.html
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title><?php echo $title?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<?php echo $description ?>">
<link rel="stylesheet" href="https://example.com/example.css">
</head>
<body>
<div id="header">
<a href="https://example.com/">
<div id="logo"><img src=""></div>
</a>
</div>
</div>
footer.html
<div>
© Copyright <?php echo $date;?>
</div>
</body>
</html>
page.html
<?php
$title="";
$description="":
define('ROOT_PATH', $argv[1]);
include(ROOT_PATH.'/header.html');
?>
<div id="content">
<h1><?php echo $title?></h1>
<p><?php echo $description?></p>
<?php
$date="2026";
include(ROOT_PATH.'/footer.html');
?>
</div>
Download the script
Licence GPL 2.0.
Exemple de site utilisant composite:
See also:
- FTP Synchronizer. Updates the content of a remote site from a local directory. Similar to Composite, but upload the page as is, doesn't execute the PHP code.

