: This article mainly introduces phpsymfony3 learning record (2) Apache Server Configuration & create the first web page. if you are interested in PHP tutorials, refer to it.
Reference: http://symfony.com/doc/current/book/page_creation.html </span>
When I learned Chapter 4 Creating your first Page in Symfony on Documentation/Book, I tried to make the first example and found that some information was not successful.
The official documentation is based on symfony2. the architecture of symfony3 has changed, and the location of some files has changed. as a result, some commands provided by the official website are not suitable for modification.
Refer to official documents: http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html
(1). configure the Apache server
1. open wamp server and find the apache configuration file httpd. conf.
2. add the following code to httpd. conf (the figure is from the official manual)
ServerName domain.tld ServerAlias www.domain.tld DocumentRoot /var/www/project/web
AllowOverride None Order Allow,Deny Allow from All
Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ app.php [QSA,L]
# uncomment the following lines if you install assets as symlinks # or run into problems when compiling LESS/Sass/CoffeScript assets #
# Options FollowSymlinks #
# optionally disable the RewriteEngine for the asset directories # which will allow apache to simply reply with a 404 when files are # not found instead of passing the request into the full symfony stack
RewriteEngine Off
ErrorLog /var/log/apache2/project_error.log CustomLog /var/log/apache2/project_access.log combined
(2). local port configuration
Enter the Directory of the project you created through the command line, and enter the command $ php bin/console server: start localhost: 8000. after this step is completed, the tutorial will be the same as the tutorial on the official website, enter http: // localhost: 8000 in the address bar to access your project.
After the above configuration is complete, you can successfully run the lucky/number example in the official manual.
The above introduces the php \ symfony3 learning record (2) Apache Server Configuration & creation of the first web page, including some content, hope to be helpful to friends who are interested in the PHP Tutorial.