Skip to content

Installation

Serghei Iakovlev edited this page Dec 5, 2017 · 11 revisions

Creating a project

Install Composer into a common location or in your project:

$ curl -sS https://getcomposer.org/installer | php

If that does not work, try this instead:

$ php -r "readfile('https://getcomposer.org/installer');" | php

Then create a project as follows:

$ php composer.phar create-project phalcon/forum

Creating a database

Then you'll need to create a database and initialize a schema. In the example below we use phosphorum as database name.

$ echo 'CREATE DATABASE phosphorum CHARSET=utf8 COLLATE=utf8_unicode_ci' | mysql -u root
$ cat schemas/forum.sql | mysql -u root phosphorum

Setting up environment variables

Phosphorum uses .env file to getting environment variables. Open the .env file and configure project credentials.

Initial test data

You can create fake entries on an empty Phosphorum installation by running:

$ /usr/bin/php /var/www/forum/forum seeder:populate

Note: This example use the following environment:

  • Full path to the PHP: /usr/bin/php
  • Full path to the Forum: /var/www/forum
  • CLI runner: forum

Directory permissions

After installing Phosphorum, you may need to configure some permissions. Directories within the storage/cache and the storage/logs with storage/pids directory should be writable by your web server or Phosphorum may not run. For example:

# Change permission to all files inside storage/cache and storage/logs directories
# except `.gitignore'.
#
# Note: You'll need to replace www-data by proper web-server user

find $(pwd)/storage/cache ! -name .gitignore -exec sudo chown www-data:"$USER" {} \;
sudo chown www-data:"$USER" $(pwd)/storage/logs
sudo chown www-data:"$USER" $(pwd)/storage/pids

Clone this wiki locally