A simple blog built in PHP
This is a basic blog engine built in PHP, without any frameworks but instead multiple composer packages linked together.
Follow these steps if you plan to install this project either locally or for production.
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).
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 migrations are done using Phinx.
To generate the tables structures in your database, simply type:
If you wish to pre-seed your local dev environment with fake data, this project contains some Phinx seeders.
You can run them by typing:
This will insert some random data into your DB tables.
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
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!