Installing Simplified Saaze on Windows 10 #2
This post provides an alternative installation route to the one described in Installing Simplified Saaze on Windows. The installation described there was using Windows Subsystem for Linux and installing Ubuntu. Some company policies might prevent this approach.
The approach described here is a Windows-only approach.
1. Downloading software. Download PHP 8.1 from PHP For Windows. The reason for 8.1 is that the yaml-extension only is available for 8.1 at the moment. Unpack the zip-file and place everything unter
Download the yaml-extension. Place the file
Download Composer-Setup.exe from the PHP Composer web-site. Run the program. Choose "For me only". It should find the PHP executable in
Download Tiny C compiler from Fabrice Bellard: the zip-file in question is tcc-0.9.27-win64-bin.zip. Unpack the zip-file at the place of your liking.
2. Configuring PHP. Copy
C:\php\php.ini. Edit the latter:
ffi.enable=trueat the end of the file
Start new DOS cmd shell. Then run
php -m. This should show that extensions FFI and yaml are activated.
3. Compiling MD4 FFI module. Place C file
md4c.c to where you installed the Tiny C compiler, and compile:
tcc -shared -rdynamic md4c.c
This should produce
md4c.def. Only the DLL is relevant. Copy the DLL file to
C:\php\ext. You can place it anywhere. It is not a PHP extension, but placing it there is not a totally bad idea.
md4c.c is an amalgamation of my FFI and the actual MD4C.
4. Installing example project. Now install example project. For this open a DOS cmd shell.
C:\User\elmar: composer create-project eklausme/saaze-example Creating a "eklausme/saaze-example" project at "./saaze-example" Info from https://repo.packagist.org: #StandWithUkraine Installing eklausme/saaze-example (v1.0) - Downloading eklausme/saaze-example (v1.0) - Installing eklausme/saaze-example (v1.0): Extracting archive Created project in /home/klm/saaze-example Loading composer repositories with package information Updating dependencies Lock file operations: 1 install, 0 updates, 0 removals - Locking eklausme/saaze (v1.19) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 1 install, 0 updates, 0 removals - Downloading eklausme/saaze (v1.19) - Installing eklausme/saaze (v1.19): Extracting archive Generating optimized autoload files
vendor/eklausme/saaze and change
Config.php and edit the line with
Finally run a build:
This should produce a directory called
C:\User\elmar\saaze-example: php saaze Building static site in ... execute(): filePath=(...)/saaze-example/content/blog.yml, nentries=35, totalPages=2, entries_per_page=20 execute(): filePath=(...)/saaze-example/content/music.yml, nentries=11, totalPages=1, entries_per_page=20 Finished creating 2 collections, 2 with index, and 46 entries
5. Dynamic mode. As mentioned in Simplified Saaze, there is also a dynamic mode in Simplified Saaze. For this start
php -S 0.0.0.0:8000 -t public
Start any browser on Windows. You should see something like this: