This guide explains how to set up and manage your new PHP backend and automated Git deployment on cPanel.
To stop manually adding/deleting files, follow these steps in your cPanel:
-
Go to "SSH Access": In cPanel, click "Manage SSH Keys" and Generate a New Key.
-
Add to GitHub: Copy the "Public Key" you just generated and add it to your GitHub SSH Settings. This lets cPanel talk to GitHub securely.
-
Go to "Git™ Version Control": Found in the "Files" section of cPanel.
-
Create a New Repository:
- Clone URL: Paste your GitHub repository URL (use the SSH version:
git@github.com...). - File Path: Set this to
public_html/repos/unicornx(or similar).
- Clone URL: Paste your GitHub repository URL (use the SSH version:
-
Automatic Deployment:
- I have included a
.cpanel.ymlfile in your project. Each time you push to Git, cPanel will see it. - Go to the repo in cPanel and click "Deploy" to move the files to
public_html. - Note: Every push to Git will now be one click away from being live!
- I have included a
To protect your passwords and email settings:
- Open
assets/php/config.phpusing the cPanel File Manager. - Update the
admin_passwordto something secure. - Git Security: This file is listed in
.gitignore, so it will NEVER be overwritten when you push new code from Git. Your server-side settings are safe.
Instead of complex MySQL databases, I've used a High-Performance JSON Database (assets/data/submissions.json):
- Automatically Setup: The system creates and updates this file automatically. You don't need to create any tables or users in cPanel.
- Combined Storage: All 4 forms (Contact, Podcast, Events, Newsletter) are saved in this one file. They are labeled by their "type" so the dashboard can sort them.
- Admin Dashboard: Access it at
yourdomain.com/admin.html. It is already connected to this JSON file and will show your latest leads instantly. - Security: Direct access to this file is blocked by a
.htaccessfile, so only your website code can read it.
- Ensure the email account
contact@unicornxmedia.comis created in cPanel (it looks like it already is!). - If emails aren't arriving, check the "Track Delivery" icon in cPanel to see if they are being blocked.
Created by Antigravity for UnicornXMedia