How to Install and Configure PhpGum in 10 MinutesPhpGum is a lightweight PHP-based toolkit designed to speed up development of small web applications and APIs. This guide walks you through installing and configuring PhpGum quickly — target time: 10 minutes. It assumes you have a working LAMP/LEMP environment (Linux, Apache/Nginx, MySQL/MariaDB, PHP 7.4+), basic command-line familiarity, and a user account with permissions to install software.
What you’ll need (approx. 1 minute)
- A server or local machine with PHP 7.4+ installed and the following extensions enabled: pdo_mysql, mbstring, json, curl, openssl.
- Composer (PHP dependency manager).
- A web server (Apache or Nginx) and a database (MySQL/MariaDB).
- Terminal/SSH access.
Step 1 — Download PhpGum (1 minute)
If PhpGum is available via Composer (recommended), run:
composer create-project phpgum/phpgum my-phpgum-app cd my-phpgum-app
If it’s provided as a ZIP or tarball, download and extract into your web root:
wget https://example.com/phpgum-latest.zip unzip phpgum-latest.zip -d /var/www/html/phpgum cd /var/www/html/phpgum
Replace the download URL with the real PhpGum package location.
Step 2 — Install dependencies (1 minute)
If you used Composer above, dependencies will be installed automatically. If not, run:
composer install
This ensures libraries PhpGum needs are available.
Step 3 — Create and configure the environment file (2 minutes)
Copy the example environment file and edit database and app settings:
cp .env.example .env
Open .env in your editor and set:
- APP_ENV=production (or development)
- APP_DEBUG=false (true for local testing)
- APP_URL=https://your-domain.com
- DB_CONNECTION=mysql
- DB_HOST=127.0.0.1
- DB_PORT=3306
- DB_DATABASE=phpgum_db
- DB_USERNAME=phpgum_user
- DB_PASSWORD=secret_password
Save the file. If PhpGum uses an encryption key, generate it (example):
php artisan key:generate
(Adjust command if PhpGum uses a different CLI.)
Step 4 — Create the database and user (1 minute)
From MySQL/MariaDB shell:
CREATE DATABASE phpgum_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'phpgum_user'@'localhost' IDENTIFIED BY 'secret_password'; GRANT ALL PRIVILEGES ON phpgum_db.* TO 'phpgum_user'@'localhost'; FLUSH PRIVILEGES;
Replace names/passwords to match your .env.
Step 5 — Run migrations and seeders (1 minute)
If PhpGum includes database migrations:
php artisan migrate --force php artisan db:seed --force
This creates required tables and optionally seeds demo data. Use the correct CLI if PhpGum differs.
Step 6 — Configure web server (2 minutes)
Apache (enable mod_rewrite) — add a VirtualHost:
<VirtualHost *:80> ServerName your-domain.com DocumentRoot /var/www/html/phpgum/public <Directory /var/www/html/phpgum/public> AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/phpgum_error.log CustomLog ${APACHE_LOG_DIR}/phpgum_access.log combined </VirtualHost>
Enable site and reload:
a2ensite phpgum.conf a2enmod rewrite systemctl reload apache2
Nginx — basic server block:
server { listen 80; server_name your-domain.com; root /var/www/html/phpgum/public; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ .php$ { fastcgi_pass unix:/run/php/php7.4-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }
Reload Nginx:
systemctl reload nginx
Adjust PHP-FPM socket path and PHP version as needed.
Step 7 — File permissions (30 seconds)
Ensure web server can read/write storage/logs (paths depend on PhpGum):
chown -R www-data:www-data storage bootstrap/cache chmod -R 775 storage bootstrap/cache
Replace www-data with your web-server user (e.g., nginx).
Step 8 — Enable HTTPS (optional but recommended, 1–2 minutes)
Use Certbot for Let’s Encrypt:
apt install certbot python3-certbot-nginx certbot --nginx -d your-domain.com
Or use the Apache plugin:
apt install certbot python3-certbot-apache certbot --apache -d your-domain.com
Follow prompts to obtain and install certificate.
Quick troubleshooting tips
- 500 errors: check web server and application logs (storage/logs).
- Database connection issues: confirm .env credentials and MySQL user host (localhost vs 127.0.0.1).
- Composer errors: ensure PHP CLI and Composer versions match web server PHP version.
Post-install checklist (30 seconds)
- Confirm site loads at APP_URL.
- If using a queue, configure supervisor or systemd for workers.
- Set up regular backups for database and storage.
- Harden production settings (APP_DEBUG=false, secure cookies, proper CORS).
You should now have PhpGum installed and running. If you tell me your OS, web server, and whether you used Composer or a ZIP, I can give the exact commands tailored to your setup.
Leave a Reply