在除root以外的所有路径上均未找到Symfony 4404页面

编程入门 行业动态 更新时间:2024-10-26 02:35:53
本文介绍了在除root以外的所有路径上均未找到Symfony 4404页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在共享主机上安装了symfony 4。 我的结构是这样的:

I have installed symfony 4 on my shared hosting. My structure is like this:

ROOT | |-- public_html | |-- tst |-- tst | |-- bin |-- config |-- src |-- translations |-- var |-- vendor |-- composer.json |-- composer.lock |-- binsymfony.lock

我将index.php从公用文件夹移动到public_html / tst文件夹,并更改了该文件中的路径以匹配新结构:

I moved index.php from the public folder to the public_html/tst folder and changed the paths inside that file to match the new structure:

require __DIR__.'/../../tst/vendor/autoload.php';

现在,当运行 http:// mysite / tst ,我可以按预期获得该网站的主页。但是,当我尝试其他路线(而不是 /)时,总是会收到未找到404页面。

Now, when running mysite/tst, I get the homepage of the site as expected. But when I try another route (other than "/"), I always receive a 404 page not found.

这是否与我缺少的特权有关?

Does this have something to do with privileges of am I missing something?

我自己想出了一个,但是如果有人告诉我如何将Symfony 4应用程序部署到共享主机上,请告诉我!我想其他人也会喜欢这个...

I figured this one out myself, but if someone tell me how to deploy a Symfony 4 application to a shared hosting, please tell me! I think other people will like this too...

推荐答案

您可以为Public创建symlik。

You can create symlik for Public. The method you try can lead to problems.

# Enter Directory Root cd /root_dir # Create Symlink ln -s public_html tst/public

更多推荐

在除root以外的所有路径上均未找到Symfony 4404页面

本文发布于:2023-11-01 22:58:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550656.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路径   均未   页面   root   Symfony

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!