Phpsymfony3 learning record (2) Apache Server Configuration & create the first web page

Source: Internet
Author: User
: 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.