π Installation Guide
Squehub is a lightweight, modern, elegant PHP framework built for performance, flexibility, and developer productivity. This guide walks you through installing the framework, setting up your development environment, and properly backing up and upgrading your project when new versions are released.
v1.2.0
β System Requirements
Ensure your system meets the following minimum requirements:
- PHP 8.2 or higher
- Composer installed globally
- Required PHP extensions:
pdo
mbstring
openssl
π Installing Composer
If Composer is not installed on your system, follow the steps below:
Windows:
- Visit getcomposer.org and download the Composer installer.
- Run the installer and complete the setup wizard.
macOS / Linux:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
sudo mv composer.phar /usr/local/bin/composer
π¦ Installing Squehub
Choose one of the installation methods below to get started:
1. Install via Composer (Recommended)
composer create-project squehub/squehub myapp
2. Clone via Git (For Contributors)
git clone https://github.com/squehub/squehub.git myapp
cd myapp
composer install
3. Download ZIP Archive
- Go to github.com/squehub/squehub
- Click Code β Download ZIP
- Extract the ZIP and run:
composer install
4. Deploy or Install on XAMPP / Live Server
You can deploy or install the Squehub framework directly on a local server (like XAMPP) or a live/production server. This is suitable for both initial development and moving a completed project to production.
- π₯ Local (XAMPP): Copy your project folder into the
htdocs/
directory (e.g.,C:/xampp/htdocs/yourapp
). - π Live Server: Upload your full project to the root directory of your server (e.g.,
/var/www/html/
).
For security and proper routing, it's recommended to configure your web server (Apache, Nginx, etc.) to serve
from the /public
directory.
- βοΈ Serving from
/public/index.php
(recommended) - βοΈ Or directly from
/index.php
in the root directory (e.g., for shared hosting)
.htaccess
redirect or symbolic
link to point to the correct entry point.
http://localhost/yourapp
(for XAMPP) or your live domain to run the app β no extra steps required.
π Project Structure
Once installed, your Squehub project will look something like this:
myapp/
βββ app/ # Application source files
β βββ Clis/ # CLI command handlers
β β βββ dump/ # Commands for data dumping/seeding
β β β βββ dump.php # Main dumper entry
β β βββ make/ # Commands for generating boilerplate code
β β β βββ MakeController.php # Generate a new controller
β β β βββ MakeDumper.php # Generate a new data dumper
β β β βββ MakeMiddleware.php # Generate a new middleware class
β β β βββ MakeMigration.php # Generate a new migration file
β β β βββ MakeModel.php # Generate a new model
β β βββ clis.php # CLI command entry file
.................. etc
π₯ Start the Server
Squehub provides a built-in CLI tool to launch a local development server without needing Apache or Nginx.
php squehub start
After running the command, open your browser and visit:
http://localhost:8000
π Running via Web Server or Hosting Panel
Squehub can also be deployed directly on local or live servers by placing the project inside a web root directory.
- For XAMPP: Place the project inside
C:/xampp/htdocs/
- For Live Servers: Upload the project to your web root, e.g.
/var/www/html
orpublic_html
By default, Squehub is designed to be served from the /public/index.php
file for better security
and routing separation.
However, it also supports being served directly from the project root via /index.php
.
- βοΈ
/public/index.php
β Recommended (set your web serverβs document root to the/public
folder) - βοΈ
/index.php
β Optional fallback if your server or shared host doesn't support document root configuration
If using shared hosting or environments without virtual hosts, you may use an .htaccess
redirect or
symlink to point requests to the appropriate entry file.
π Environment Configuration
The .env
file is used to define environment-specific variables such as database credentials and
application settings. This file is critical for managing different configurations between local development,
staging, and production.
If your project is missing the .env
file, you can generate it by copying the default template:
cp .env.example .env
π Default .env Example
APP_NAME="SqueHub Framework"
DB_HOST=localhost
DB_DATABASE=squehub-officlal
DB_USER=root
DB_PASSWORD=
APP_ENV=development
APP_DEBUG=true
π Explanation of Each Variable
APP_NAME
β The name of your application, shown in titles and error pages.DB_HOST
β Your database host (typicallylocalhost
or a remote IP).DB_DATABASE
β The name of your database schema.DB_USER
β The username used to connect to your database.DB_PASSWORD
β The password for the above database user.APP_ENV
β The current application environment (development
,production
, etc.). This controls debugging, error reporting, and behavior.APP_DEBUG
β Enables or disables debug mode (true
shows full error traces,false
hides them).
π Keep It Secure
.env
file to version control (e.g., Git). It
contains sensitive information such as credentials and debug settings.
π Tip for Shared Hosting
If you're deploying on shared hosting and the command cp .env.example .env
isn't available, just
manually duplicate the .env.example
file, rename it to .env
, and edit the contents
accordingly.
βοΈ Email Configuration
Squehub handles outgoing emails using settings defined in config/mail.php
. Unlike some frameworks
that rely on the .env
file, all mail configuration in Squehub is centralized and editable directly
via PHP.
Here is the default configuration:
'host' => 'mail.Squehub.com',
'port' => '587',
'username' => 'dev@Squehub.com',
'password' => '123456790$',
'encryption' => 'tls',
'from_address' => 'dev@Squehub.com',
'from_name' => 'Squehub Framework'
π§ Updating Mail Settings
To use your own mail service (like Gmail, Mailgun, SendGrid, etc.), open config/mail.php
and update
the values accordingly:
return [
'host' => 'smtp.yourmailserver.com',
'port' => '587',
'username' => 'your@email.com',
'password' => 'your-mail-password',
'encryption' => 'tls',
'from_address' => 'your@email.com',
'from_name' => 'Your App Name'
];
.gitignore
.