larave框架的安装

(1)中文官网:http://www.golaravel.com/

(2)composer下载与安装

    1:composer网址:getcomposer.org

    2:windows下载Composer-Setup.exe :https://getcomposer.org/Composer-Setup.exe    

    3:  下载之后点击安装,并指定到你当前运行的php.exe 执行文件。如:D:phpStudyphp54nphp.exe 

         注意:如果报一下错[则没开启php的openssl],开启php-openssl 扩展即可  

        Some settings on your machine make Composer unable to work properly.
        Make sure that you fix the issues listed below and run this script again:

        The openssl extension is missing, which means that secure HTTPS transfers are impossible.
        If possible you should enable it or recompile php with --with-openssl

(3)检测composer安装是否正确

    windows+r  在输入cmd 回车。在输入Composer 回车。看是否有一个图形出来,如果有则说明安装成功。

(4)laravel程序的安装

    在命令窗口输入composer  create-project laravel/laravel --prefer-dist  my-laravel

    参数解释:laravel/laravel    下载laravel下的和心库  

                 --prefer-dist     下载压缩版的

                 my-laravel         项目名称

   如看到最后是,set successfully 说明下载larave成功

(5)访问laravel项目

      第一种直接放到www目录:http://localhost/my_laravel/public/ 

      第二种cmd中设置:php -S localhost:80  -t  /my_laravel/public/   

                                直接访问localhost即可

(6)注意项

    1:如果是在linux上部署,那么访问的时候必须给storage,wendor两个文件对应的服务

      lamp:  chown -R apache:apache  /www/my_laravel/storage

           和  chown -R apache:apache  /www/my_laravel/wendor

     lnmp:   chown -R nginx:nginx /www/my_laravel/storage

          和  chown -R nginx:nginx /www/my_laravel/wendor

     

原文地址:https://www.cnblogs.com/hgj123/p/5042714.html