简体   繁体   English

将laravel项目部署到服务器?

[英]Deploying laravel project to server?

Firstly, I have deployed a Laravel project from Windows to server by copying everything in my Laravel folder and upload them to server, after configuring .htaccess, it ran successfully. 首先,我通过复制Laravel文件夹中的所有内容并将它们上传到服务器,从Windows到服务器部署了一个Laravel项目,配置.htaccess后,它成功运行。

And then, I added a new package named "dompdf" by using command line, and it ran successfully in my Windows local. 然后,我使用命令行添加了一个名为“dompdf”的新包,并在我的Windows本地中成功运行。 But I don't know how to deploy this package to linux server. 但我不知道如何将此软件包部署到Linux服务器。 I have tried but it failed. 我试过但失败了。

Do I have to install composer on the Linux server? 我是否必须在Linux服务器上安装composer?

Do I need to re-install again on the Linux server? 我是否需要在Linux服务器上重新安装?

I have asked some people. 我问了一些人。 But they have always said that "you have to install composer on Linux server". 但他们总是说“你必须在Linux服务器上安装composer”。 But I realize that I do not need to install anything at all. 但我意识到我根本不需要安装任何东西。 I just uploaded and override file app/config/app.php and some folders in the vendor folder that are new or changed after I added the package "dompdf". 我刚刚上传并覆盖了文件app / config / app.php和vendor文件夹中的一些新文件夹或者在我添加了包“dompdf”后更改的文件夹。

Sorry about my English. 抱歉我的英文。 If something is wrong, please correct it for me. 如果出现问题,请为我更正。

You need to install the package using Composer : 您需要使用Composer安装软件包:

1) Require this package in your composer.json : 1)在composer.json需要这个包:

'barryvdh/laravel-dompdf": "0.4.*'

2) do a composer update from your terminal: php composer.phar update 2)从你的终端做一个作曲家更新: php composer.phar update

3) After updating composer, add the ServiceProvider to the providers array in app/config/app.php 3)更新编写器后,将ServiceProvider添加到app/config/app.php的providers数组

'Barryvdh\DomPDF\ServiceProvider',

4) You can optionally use the facade for shorter code. 4)您可以选择使用Facade来缩短代码。 Add this to your facades: 将此添加到您的外墙:

'PDF' => 'Barryvdh\DomPDF\Facade',

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM