用框架重新构建的博客

动态 0 291

摘要:

php有很多开源的框架可选,thinkphp作为比较简单的框架有着很多优势
  • 有很多开源框架在github上选择thinkphp是因为它比较简单易上手
  1. thinkphp5入门基础 https://www.imooc.com/learn/832
  2. thinkphp5模型入门 https://www.imooc.com/learn/854
  3. 学完之后 架设服务器

  4. 服务器有很多选择  我用的是阿里云(毕竟本人是学生没那么多钱)

  5. 如图服务器要开启  重写


  6. #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options  FollowSymLinks ExecCGI
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    # AllowOverride None  改为 AllowOverride All
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Require all granted

  7. 在public目录下  建立  .htaccess 文件 如下所示(没有文件名只有.htaccess后缀

  8. Options +FollowSymlinks -Multiviews
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]

  9. 到此为止服务器基本配置完成

  10. 访问 www.encai.online(我的个人博客)如下所示



回帖
  • 消灭零回复
您没有登录请点击登录