Phpsymfony3 Learning Record (ii) Apache server configuration & Create first page

Source: Internet
Author: User
Tags tld
Reference: http://symfony.com/doc/current/book/page_creation.html

In the fourth chapter of the study Documentation/book creating your first Page in Symfony, tried to do a little bit of success, and looked up some information, found that there is no configuration to do.

The official document is written based on Symfony2, Symfony3 's architecture has changed, some of the files have changed in location, resulting in some of the official commands that are not applicable to be modified accordingly.

Refer to the official documentation: http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html

(1). For Apache server configuration

1. Open Wamp Server and locate the Apache configuration file httpd.conf


2. Add the following code to the httpd.conf (figure from the official manual)

   
     the
    >ServerName domain.tld Serveralias www.domain.tld documentroot/var/www/project/web
      var/www/project/web 
       < span="">  > allowoverride None Order allow,deny  
        
        < span=""> allow from all 
       
        mod_rewrite.c
        > 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 to problems when compiling Less/sass/coffe Script Assets #
      var/www/project > # Options 
       < span=""> FollowSymLinks #  
 
  
  
  
  
  
  
 # Optionally disable the rewriteengine for the asset directories # which'll allow Apache to simply reply with a 404 W hen files is # found instead of passing the request into the full symfony stack
     var/www/project/web/ 
       < span="">   bundles>    mod_rewrite.c ><> < span=""> Rewriteengine <> Off   
 
  
  
  
  
  
  
  
  
  
          
  
 Errorlog/var/log/apache2/project_error.log Customlog/var/log/apache2/project_access.log combined
    
   
(2). Local port configuration

from the command line into the project directory you created, type the command: $ php bin/console server:start localhost:8000, This step can be done with the official website tutorial, by typing in the address bar C2>http://localhost:8000 to visit your project.

Once the above configuration is complete, you can successfully run the Lucky/number example in the official manual.

The above describes the Php\symfony3 learning record (ii) Apache server configuration & Create the first Web page, including the content, I hope to be interested in PHP tutorial friends helpful.

  • 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.