Menu Close


Hacker News clone in PHP

This is a clone of Hackernews written in PHP.


  • Submit stories or ask questions.
  • Recursive comments
  • Vote on questions and comments
  • Stories are ranked based on user votes using an algorithm similar to hacker news ranking.

Screen shots

Front Page

Front Page



System Requirements

This has been tested on

  • PHP >= 5.2.X
  • MySQL >= 5.6


Installation requires access to a command line.

  • Clone/download the repository
  • Install dependencies
composer install
  1. Rename config.ini.template to config.ini
  2. Update config.ini with your database information
  • Make sure the database already exists (this installation does not create the database)
  • Make sure the db user has permission to create tables.
  1. execute php install.php
  2. edit your crontab and add cron.php to execute every 30minutes.
  • Open crontab for editing
crontab -e

Add this line, with ABSOLUTE_PATH_TO_INSTALL_FOLDER set correctly.

*/30 * * * * php /ABSOLUTE_PATH_TO_INSTALL_FOLDER/cron.php
  1. goto http://{{YOUR_WEBSITE}}/signup.php and create a new user:
  2. Done. Start creating stories.

To Do

  • Rank comments using the same time weighted algorithm as stories
  • Change comment table structure to make it more efficient.


Hackernews is released under the MIT License. See LICENSE file for details.

View Source Code
Posted in Development