Traditional Deployment

Prisma PHP supports traditional deployment methods such as using FTP clients (like FileZilla) or uploading a ZIP archive directly to your hosting provider (e.g., cPanel). This method is particularly useful for shared hosting environments or simple setups where containerization is not required.

Steps to Deploy Prisma PHP Using FTP or ZIP

  1. Prepare the Project for Production:
    Run the following command to compile your assets and prepare your project:
    npm run build
    This command processes your CSS and JavaScript, ensuring everything is optimized for production.
  2. Exclude Unnecessary Files:
    Before uploading, exclude the following directories:
    • node_modules/ – not required in production
  3. Create a ZIP Archive (Optional):
    If your hosting supports upload via file manager (e.g., cPanel), zip the prepared project folder excluding the files above and upload it to the root of your public web directory (often public_html).
  4. Upload via FTP (Alternative Method):
    Use an FTP client such as FileZilla and upload all project files (excluding node_modules) to the root directory of your hosting environment.
  5. Set Up Environment Variables:
    Edit the .env file and configure the following:
    # SHOW ERRORS - Set to true to show errors in the browser for development only - Change this in production to false
    SHOW_ERRORS="false"
    
    # APP TIMEZONE - Set your application timezone - Default is "UTC"
    APP_TIMEZONE="UTC"
    
    # APP ENV - Set your application environment - Default is "development" - Change this in production to "production"
    APP_ENV="production"
    
    # DATABASE URL - Set your database connection string - if you are using a database
    DATABASE_URL="mysql://user:password@localhost:3306/prisma_php"
    Adjust the database credentials according to your hosting database configuration.
  6. Ensure Permissions Are Correct:
    Set appropriate read/write permissions for:
    • /prisma – ensure configuration files are present and readable (required if using database)
    • /settings – ensure configuration files are present and readable
    • /src – ensure route and template files are readable
    • /vendor – ensure all PHP dependencies are uploaded
  7. Access the Application:
    Open your domain (e.g., http://yourdomain.com). If everything is correctly uploaded and configured, you should see the Prisma PHP app working as expected.

Recommended Project Structure for Deployment

All directories and files below should be included except those explicitly excluded:

Prisma PHP Project
        ├── prisma/ 
        ├── settings/ 
        ├── src/ 
        ├── vendor/ 
        ├── .env 
        ├── .gitignore
        ├── .htaccess
        ├── bootstrap.php 
        ├── composer.json 
        ├── composer.lock 
        ├── package-lock.json
        ├── package.json
        ├── postcss.config.js
        ├── prisma-php.json
        ├── tsconfig.json
        ├── [... other core files ...]

Next Steps

  • Secure your .env file – it should never be publicly accessible. By default, Prisma PHP includes secure layer rules in .htaccess to protect sensitive files, but you can further improve these rules if desired.
  • Enable HTTPS from your hosting panel to secure the site.
  • Schedule regular backups and optionally set up cron jobs via CPanel for maintenance tasks.

With these steps, your Prisma PHP project will be fully deployed using a traditional and accessible method, even without containerization tools like Docker.