Tag: second_crack

Running Second Crack on a Windows computer

This blog is hosted on a Linux server, but I generate the blog on my Windows laptop. Some small changes are required in order to get it to work on Windows. The readme.md on the Second Crack is very elaborate in the installation notes. This blogpost only describes the changes I had to make to get it to work on Windows.

Installation

I have installed Second Crack in a separate folder, in C:\apps\secondcrack. The source files are placed in _C:\blog_, in the following structure:

\cache
\drafts
\media
\pages
\posts
\templates
\www
    \css
    \js
    \img

The config.php in the Second Crack folder I have changed to reflect this structure.

Code change

The update.php script in the Second Crack engine folder which triggers the blog update must be changed. A locking mechanism has been implemented in this file, but it does not work under Windows because the used PHP extension (POSIX) is not available.
Thefore the lines in update.php related to locking must be commented out. This is the following snippet as an example:

update.php
<?php
/*define('LOCK_FILE', isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : '/tmp/secondcrack-updater.pid');

// Ensure that no other instances are running
...
    fwrite(STDERR, "Cannot write lock file: " . LOCK_FILE . "\n");
    exit(1);
}*/

$fdir = dirname(__FILE__);

This will disable all functionality related to locking. Now updating the blog is a matter of executing (assuming the php.exe is installed in c:\php\php.exe:

c:\php\php.exe c:\apps\secondcrack\engine\update.php

Leave a Comment