简体   繁体   中英

Mezzio skeleton application on Centos 8

I try to run a Mezzio application on my server I do the following steps : - Create a Mezzio project

composer create-project mezzio/mezzio-skeleton symphonie

I choose modular application, fast router, service manager, plates renderer and Whoops I create my virtual host like this :

<VirtualHost *:80>
        Alias /symphonie "/data/symphonie/public"
    <Directory "/data/symphonie">
        Options Indexes MultiViews FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

But when I enter this url in Google Chrome : https://app.inra.fr/symphonie/ I got a 404 error. I have no messages in the apache logs. By cons all the links on the page redirects me to https://app.inra.fr/ and not to https://app.inra.fr/symphonie/ Here is the configuration of my server:

  • Centos 8
  • Apache 2.4 with rewrite module enabled
  • PHP 7.3

Do you have any leads to solve my problem?

thanks in advance

Shishi

Mezzio application does not have built-in support for base path.

You would need to handle following aspects:

  • web server rewrites for subfolder. Looks like you did that part.
  • middleware will need to be piped early to remove base path from request object before passing it further
  • base path url helper.
    Mezzio provides url helper in mezzio/mezzio-helpers package. Middleware from the previous step could also be used to inject base path into url helper. If some of your middlewares use different ways to handle urls, those will need to be setup as well.

Mezzio documentation have the page covering this use case: https://docs.mezzio.dev/mezzio/v3/cookbook/using-a-base-path/
It is not too detailed and pull requests to improve it are welcome ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM