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
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 .
© 2024 OneMinuteCode. All rights reserved.