Skip to content
Pix is an image hosting service.
PHP JavaScript CSS
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.
app
public
templates
.gitignore
README.markdown
composer.json
config.ini-dist

README.markdown

Pix

Pix is an image hosting service.

This tools was originaly build for Toile-Libre with the help of:

Demo

Setup

  • Run composer to fetch dependencies:

      composer install
    
  • Create a MySQL database and import schema:

      CREATE TABLE `images` (
          `id` INT(11) AUTO_INCREMENT,
          `type` VARCHAR(255),
          `slug` INT(11),
          `date` DATETIME,
          `private` TINYINT(3) DEFAULT 0,
          `size` INT(11),
          `user_id` INT(11),
          `popularity` INT(11) DEFAULT 0,
          PRIMARY KEY (`id`),
          UNIQUE KEY (`slug`),
          KEY (`user_id`)
      );
    
      CREATE TABLE `image_tag` (
          `id` INT(11) AUTO_INCREMENT,
          `tag_id` INT(11),
          `image_id` INT(11),
          PRIMARY KEY (`id`),
          UNIQUE KEY (`image_id`,`tag_id`),
          KEY (`tag_id`)
      );
    
      CREATE TABLE `tags` (
          `id` INT(11) AUTO_INCREMENT,
          `label` VARCHAR(255),
          PRIMARY KEY (`id`),
          UNIQUE KEY (`label`)
      );
    
      CREATE TABLE `users` (
          `id` INT(11) AUTO_INCREMENT,
          `username` VARCHAR(255),
          `password` VARCHAR(255),
          PRIMARY KEY (`id`),
          UNIQUE KEY (`username`)
      );
    
  • Rename config.ini-dist in config.ini, then edit it (in particular, informations related to MySQL connection):

     driver = mysql
     host = localhost
     database = pix
     username = root
     password = 
    
  • Change permissions for data directory (HTTPd needs a write access):

      mkdir data/
      chown -R you:httpd data/
      chmod -R 775 data/
    
  • Here is a workig Nginx config:

      server {
              listen                  80;
              server_name             pix.mydomain.tld;
              root                    /path/to/pix/public;
              index                   index.php;
              try_files               $uri $uri/ /index.php?$query_string;
      }
    

Upgrade

If you want to upgrade from v2.x of Pix:

  • Update PHP dependencies using composer:

      composer install
    
  • Update MySQL schema:

      RENAME TABLE `image` TO `images`;
      RENAME TABLE `tag` TO `tags`;
      RENAME TABLE `user` TO `users`;
    
You can’t perform that action at this time.