I want to display the app I created on MAMP and Symphony, but even if I type the URL I entered in routes.yaml, it becomes Not Found.

Asked 2 years ago, Updated 2 years ago, 361 views

I'm studying Symphony now.

I wanted to use MAMP to display the page I created in my browser, but when I entered the URL I registered with routes.yaml, it didn't appear.

We did the following:

Create a controller and twig with the following commands

php bin/console make:controller

Edit route.yaml

home_page:
    path: /home_page
    controller:App\Controller\HomeController::index

Run the following command

composer require symfony/apache-pack

Enter "localhost:8888/mysite/home_page" in your browser

Even if you try these
US>"Not Found
The requested URL was not found on this server.
It says

The file you created is located in MAMP/htdoc.

However, you can enter localhost:8888 or localhost:8888/mysite to view index.html created in each directory in your browser.

However, even if you enter localhost:8888/mysite/home_page", you cannot open the Tiwg created in php bin/console make:controller .

I don't understand the problem.

php macos mamp symfony

2022-09-30 21:58

1 Answers

http://localhost:8888/mysite/public/index.php/home_page
Can't we?
I used MAMP to move Symphony, and now it works.
(The index.php below the public folder is called the front controller in Codeigniter.)

Configure virtualhost to
For example, if you visit http://localhost:5005/home_page,
http://localhost:8888/mysite/public/index.php/home_page
It may be smart to have access to the .


2022-09-30 21:58

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.