A simple blog built in PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cache
frontend
logs
src
tests
.env.example
.gitignore
.travis.yml
README.md
bootstrap.php
cli-config.php
composer.json
composer.lock
phpunit.xml

README.md

simple-blog

A simple blog built in PHP

Build Status Coverage Status

This is a basic blog built in PHP, without any frameworks but instead multiple composer package linked together.

Installation

Follow these steps if you plan to install this project either locally or for production.

Introduction

Make sure you have at least PHP 7.2 installed, a MySQL server, and composer.

In the root of the project, type composer install to install all the dependencies.

Then, make a copy of .env.example into a .env file, and change the env parameters as you need (including the DB ones).

HTTP Server

On dev environment, you can start a simple PHP server by running the following from the root of the project:

php -S localhost:8000 -t frontend/public/

You can of course use any other HTTP server of your choice. Just note that the root folder is frontend/public, with the index.php file as an entry point.

SQL

To generate the SQL queries you need for tables creation, simply type :

vendor/bin/doctrine orm:schema-tool:update --dump-sql

And either copy / paste the SQL into your MySQL client, or add the --force option to directly run it.

Admin

Once the project is installed, head over to the /admin URL in your browser to access the admin interface. (That would be http://localhost:8000/admin on dev)

It will ask you for the admin credentials you set in .env.

On the admin index, you'll need to update the Blog Configuration. There, you can set the name of your blog, a short description of it for the home page, and some text about you and your blog that will display on the about page.

You'll also need at least one author created through admin.

Once this is all done, you should be ready to write blog posts!