flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.6k stars 407 forks source link

get 403 error on Heroku server #447

Closed meko3 closed 5 months ago

meko3 commented 3 years ago

Hi, I want to use flightPHP on Heroku. But I got 403 Error on Heroku. on Local server, this code went well.

Is This problem because of my code or because of Heroku server?

Here is code.

Procfile

web: vendor/bin/heroku-php-apache2 src/

.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
<?php
require 'vendor/autoload.php';

Flight::set("layout", "templates/Layout");

Flight::route("/", function() {
    Flight::render("templates/head", array("style" => "front"), "head_content");
    Flight::render("templates/header", null, "header_content");
    Flight::render("pages/front", null, "body_content");
    Flight::render("templates/footer", null, "footer_content");
    Flight::render(Flight::get("layout"));
});

Flight::start();

Structure

.git
src
  |-views
    |-templates
  |-.htaccess
  |-Index.PHP
.gitignore
composer.json
composer.lock
Procfile
magikstm commented 3 years ago

Did you try uploading and viewing an image or another simple file on that server?

A 403 is possibly that the server or apache config isn't allowing external requests.

krmu commented 5 months ago

@meko3 still actual?