📖 Setup & Documentation
Complete guide to deploying, configuring, and managing your PortfolioForge installation.
Edit config.php
Open config.php and update your database credentials, site URL, and site name.
define('DB_HOST', 'localhost');
define('DB_USER', 'your_cpanel_db_username');
define('DB_PASS', 'your_db_password');
define('DB_NAME', 'portfolioforge');
define('SITE_URL', 'https://yourdomain.com');
Upload All Files
Upload the entire folder content to your cPanel's public_html directory using FileZilla or cPanel File Manager.
Run the Installer
Visit https://yourdomain.com/install.php in your browser and click "Run Installation". Then delete install.php!
Using FileZilla (FTP)
1. Download FileZilla from filezilla-project.org
2. In cPanel, create an FTP account under FTP Accounts
3. Connect using: Host: yourdomain.com | Port: 21
4. Navigate to public_html on the right panel
5. Drag and drop all files from the left (local) panel
6. Wait for upload to complete
Using cPanel File Manager
1. Log into cPanel → File Manager → public_html
2. Click Upload button
3. ZIP all files first, then upload the ZIP
4. Right-click ZIP → Extract
5. Move extracted files to root if needed
public_html root, not in a subfolder. If using a subfolder (e.g., /portfolio), update SITE_URL in config.php accordingly.config.php. Here's what each setting does:| Setting | Description | Example |
|---|---|---|
DB_HOST | Database host (usually localhost) | localhost |
DB_USER | Database username from cPanel | mysite_dbuser |
DB_PASS | Database password | SecurePass123 |
DB_NAME | Database name | mysite_portfolio |
SITE_URL | Full URL without trailing slash | https://mysite.com |
SITE_NAME | Your site/brand name | MyPortfolio |
ADMIN_EMAIL | Admin contact email | admin@mysite.com |
Step 1: Create Template Folder
Create a new folder in templates/ with your template name (lowercase, no spaces):
templates/
└── mytemplate/ ← your new template folder
├── template.php ← required: the template HTML/PHP
├── meta.json ← required: template metadata
├── preview.jpg ← recommended: 800×500 preview image
└── style.css ← optional: additional styles
Step 2: Create meta.json
{
"id": "mytemplate",
"name": "My Awesome Template",
"description": "A beautiful template for creative professionals.",
"tags": ["modern", "creative", "colorful"]
}
Step 3: Create template.php
The template receives a $data array with these fields:
$data = [ 'full_name' => 'John Doe', 'title' => 'Developer', 'about' => 'Bio text...', 'email' => 'john@example.com', 'phone' => '+1234567890', 'location' => 'New York, USA', 'exp_years' => '5+ years', 'skills' => ['PHP', 'React', 'MySQL'], 'experience' => [['title'=>'...','company'=>'...','start'=>'...','end'=>'...','desc'=>'...']], 'projects' => [['name'=>'...','tech'=>'...','desc'=>'...','url'=>'...','github'=>'...']], 'profile_image' => 'https://yourdomain.com/uploads/profile_xxx.jpg', 'accent_color' => '#667eea', 'social' => ['linkedin'=>'...','github'=>'...','twitter'=>'...','website'=>'...'], ];
Change Site Name & Tagline
Edit these lines in config.php:
define('SITE_NAME', 'YourBrandName');
define('SITE_TAGLINE', 'Your Custom Tagline Here');
Change Logo Icon
In index.php and create.php, find the .logo-icon element and replace the ⚡ emoji with your preferred icon or replace it with an <img> tag:
<div class="logo-icon"> <img src="assets/img/logo.png" alt="Logo" width="36" height="36"> </div>
Change Colors
In assets/css/style.css, edit the :root variables at the top:
:root {
--primary: #667eea; ← Change to your brand color
--secondary: #764ba2; ← Change secondary color
}
Root Domain Setup (yourdomain.com)
Upload files to public_html/ and set:
define('SITE_URL', 'https://yourdomain.com');
Subdirectory Setup (yourdomain.com/portfolio)
Upload files to public_html/portfolio/ and set:
define('SITE_URL', 'https://yourdomain.com/portfolio');
Also update the RewriteBase in .htaccess:
RewriteBase /portfolio/
📊 View Database
Go to cPanel → phpMyAdmin → Select your database → Browse the portfolios table to view all generated portfolios.
🗑 Delete Old Portfolios
In phpMyAdmin, run:
-- Delete portfolios older than 90 days DELETE FROM portfolios WHERE created_at < DATE_SUB(NOW(), INTERVAL 90 DAY);
📁 Clean Upload Files
Uploaded images are stored in uploads/. Use cPanel File Manager to delete old ones or add this SQL query to find orphaned records:
SELECT id, slug, created_at FROM portfolios ORDER BY created_at DESC;
💾 Database Backup
cPanel → Backup Wizard → Select your database → Download. Schedule automatic backups in cPanel → Backup if available.
Q: Portfolios show 404 after upload?
Make sure your hosting has mod_rewrite enabled. Check cPanel → Apache Modules. Also verify .htaccess was uploaded correctly (some FTP clients hide dotfiles).
Q: Images not uploading?
Check that the uploads/ folder exists and has write permissions (755 or 777). In cPanel File Manager, right-click → Change Permissions.
Q: How to add password protection?
Use cPanel → Directory Privacy to add HTTP basic auth to your site, or add a session-based admin panel.
Q: Can I use this on localhost?
Yes! Use XAMPP or Laragon. Set SITE_URL to http://localhost/portfolioforge and enable mod_rewrite in Apache.
Q: How to limit or disable public portfolio creation?
In generate.php, add a secret key check or comment out the form submission handling. You can redirect unauthorized requests to a login page.