This document will instruct you in setting up Postmill for testing purposes.
(Psst! Instead of setting up PHP and all that stuff yourself, a better way to get started is using Docker.)
Make sure you have all the requirements available:
- PHP >= 7.3 with the curl, gd, iconv, intl, json, mbstring, PDO_PGSQL, tokenizer, and xml
- (optional) The amqp extension is required to use RabbitMQ.
- PostgreSQL >= 9.4
- Node 10 or newer and Yarn
Postmill should be able to run under any Unix environment. It has been tested to work under Linux, macOS, and Windows 10's Linux subsystem. Running directly on Windows may work, but is unsupported.
Clone the repository
Clone the repository somewhere and navigate there with the command line.
$ git clone https://gitlab.com/postmill/Postmill.git $ cd Postmill
Building the assets
$ yarn install $ yarn run build-prod
public/build directory should now be populated.
Setting up the backend
If this command fails, it is likely because your system doesn't have the minimum required PHP version or the necessary extensions. With PHP 8, it is currently necessary to run this command with the option
--ignore-platform-req=php, as may libraries don't announce PHP 8 compatibility (but still work fine).
vendor/bin/requirements-checkerto check your PHP config for any misconfigurations. Fix any errors that arise.
Set up a PostgreSQL database.. You need a username, password, hostname (usually
localhost), port (usually
5432), database name, and server version to continue.
Create an empty
.env.localfile in the project root. At minimum, you must define your database configuration here:
You can copy other values from
.envto override them in your installation.
bin/console doctrine:migrations:migrateto load the database schema.
php -S 127.0.0.1:8000 -t publicto start the application.
Navigate to http://localhost:8000/.
You should be good to go! A good next step would be to learn how to manage admin accounts.