简体   繁体   English

如何在服务器面板上运行composer安装

[英]how to run composer install on the server cpanel

I have successfully uploaded my symfony app to the server. 我已成功将我的symfony应用程序上传到服务器。 I have also copied the content of the web folder into the public_html folder of my website. 我还已经将Web文件夹的内容复制到我网站的public_html文件夹中。 But when I access my app via the www.domain.com I get this error 但是,当我通过www.domain.com访问我的应用程序时,出现此错误

Warning: require_once(/home/domain/public_html/../app/bootstrap.php.cache): failed to open stream: No such file or directory in /home/domain/public_html/app.php on line 6

Fatal error: require_once(): Failed opening required '/home/domain/public_html/../app/bootstrap.php.cache' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/domain/public_html/app.php on line 6

After researching I found that you can run composer install on the server but my challenge is that I dont know how to run cli command on the server via ssh/cpanel. 经过研究,我发现您可以在服务器上运行composer install,但是我的挑战是我不知道如何通过ssh / cpanel在服务器上运行cli命令。

Please who will be kind enough to show me the way. 请谁会好心地给我指路。 This is my first attempt on trying to host a symfony application 这是我首次尝试托管symfony应用程序

When you don't run an composer install your dependencies are missing and the bootstrap.cache.php isn't created. 当您不运行作曲家时,将丢失您的依赖项,并且不会创建bootstrap.cache.php So you have to upload the file and the complete vendor folder. 因此,您必须上传文件和完整的供应商文件夹。

But i would prefer to take a look at your SSH connection and use the correct way. 但是我更希望看看您的SSH连接并使用正确的方式。 Otherwise you have to upload every time your complete sources including your vendor folder which can take a lot of time. 否则,您每次都要上载完整的资源(包括供应商文件夹)时都需要上载,这可能会花费很多时间。

And the next think is your path. 接下来的想法就是你的道路。 The components from your Symfony application are normally outside of your webroot. Symfony应用程序中的组件通常位于webroot之外。 So you have to be sure that you can access that folders outside your webroot. 因此,您必须确保可以访问Webroot之外的文件夹。

In some systems you have to allow that before you can use it. 在某些系统中,必须先允许它,然后才能使用它。 Otherwise you have to upload your complete application to your public_html folder and put your domain to the web subdirectory. 否则,您必须将完整的应用程序上载到public_html文件夹,然后将域放入web子目录。

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

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