404 when running on apache #111
-
Hi there, I just tried to use framework-x but got stopped right away. require __DIR__ . '/vendor/autoload.php';
$app = new FrameworkX\App();
$app->get('/', function () {
return new React\Http\Message\Response(
200,
[],
"Hello wörld!\n"
);
});
$app->run(); I only get 404 when I try to access it on my local (subdirectory) - however using the builtin webserver it works. Thanks in advance. P.S.: I havn't used a public dir instead just put the index.php into the docroot, shouldn't be an issue or is there some internal requirement to serve from public? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hey @p13rnd, thanks for bringing this up 👍 Running your code on apache needs some additional setup which is not necessary when working with the built-in webserver. One difference is to adjust your
There is no requirement to add a public dir, but we always recommend doing it. In our cases the public folder functions as our document root. Only files, where it's not critical if other people can access them, should be in there, for example if you have an I hope this helps, if you have any more questions let us know 👍 |
Beta Was this translation helpful? Give feedback.
-
Ah got it! I've missed the production deployment part of the docs as my intention was to only try the framework first. You may want to add this part to the quickstart section so people won't miss it and get turned off. For the public dir part, I am well aware of the security constraints but havn't been entirely sure if there are any other framework enforced conventions. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@p13rnd You're right, there should be a reference somewhere inside the quickstart section, thanks for pointing that out 👍 I've already submitted a pull request: #112 |
Beta Was this translation helpful? Give feedback.
Hey @p13rnd, thanks for bringing this up 👍
Running your code on apache needs some additional setup which is not necessary when working with the built-in webserver. One difference is to adjust your
.htaccess
file when using apache. You can read all about this in our documentation. The.htaccess
file looks something like this:There is no requirement to add a public dir, but we always recommend doing it. In our cases the public folder functions as our document root. Only files, where it's not critical if other people can access them, should be in there, for example if you have…