Photo7 Installation Guide

This guide walks you through installing and running the Photo7 photography portfolio + print shop on your server or local machine.

1) Requirements

2) Get the Code

git clone <your-repo-url> photo7
cd photo7

3) Create Database

mysql -u root -p -e "CREATE DATABASE photo7 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -u root -p photo7 < sql/schema.sql

4) Configure Connection & App Settings

  1. Copy config/config.php if needed and set DB credentials:
    return [
        'db' => [
            'host' => '127.0.0.1',
            'port' => 3306,
            'name' => 'photo7',
            'user' => 'photo7_user',
            'pass' => 'secret',
        ],
        'app' => [
            'name' => 'Photo7',
            'url' => 'https://your-domain.test',
            'admin_email' => 'you@example.com',
            'timezone' => 'UTC',
            'debug' => false,
        ],
        'mail' => [
            'to' => 'you@example.com',
        ],
        'openai' => [
            'api_key' => '',
            'model' => 'gpt-4o-mini',
        ],
    ];
          
  2. Set 'url' to your public base URL.
  3. Optional: add PayPal keys and OpenAI key in the admin Settings later.

5) File Permissions

6) Configure Virtual Host

Point your vhost to public/.

Apache

<VirtualHost *:80>
    ServerName photo7.test
    DocumentRoot /path/to/photo7/public
    <Directory /path/to/photo7/public>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Nginx (PHP-FPM)

server {
    listen 80;
    server_name photo7.test;
    root /path/to/photo7/public;
    index index.php;

    access_log /var/log/nginx/photo7.access.log;
    error_log  /var/log/nginx/photo7.error.log;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; # adjust to your PHP-FPM socket
        fastcgi_read_timeout 60s;
    }

    location ~* \.(jpg|jpeg|png|gif|webp|svg|ico|css|js|woff2?)$ {
        expires 30d;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }
}

7) Create the First Admin User

  1. Start your web server and browse to /admin/setup.
  2. Fill in the admin email/password to create the first admin account.
  3. After setup, log in at /admin/login.

8) Verify Key Features

9) Optional: Performance & Assets

10) Troubleshooting

That’s it! You should now have Photo7 running with admin access, uploads, search, tags, and (optionally) the print shop.