简体   繁体   English

如何在共享主机上生产的laravel应用中添加提供程序和别名

[英]how to add providers and aliases to laravel app which is in production on shared hosting

I want to add 2 providers and aliases to my laravel app . 我想在我的laravel应用程序中添加2个提供程序和别名。 but when I do this in a normal way ie going to config/app.php and add them to providers and aliases section. 但是当我以常规方式执行此操作时,即转到config / app.php并将其添加到提供程序和别名部分。

The error is displayed that 错误显示

service provider not found 找不到服务提供商

I have cpanel version 60.0.32 .Also composer can't be installed on the server so there is no medium to run composer commands. 我的cpanel版本为60.0.32。此外,服务器上也无法安装composer,因此没有介质可以运行composer命令。

Have you tried installing composer through curl. 您是否尝试过通过curl安装作曲器。 I faced the same issue and I did this. 我遇到了同样的问题,我做到了。

Once I clone the repository, I cd in to it and did a 有一次,我clone库,我cd中,并做了

curl -sS https://getcomposer.org/installer | php

Then I ran whereis php to check available php versions. 然后我运行whereis php检查可用的php版本。 In my case the default php cli was php5.4 (output of php -v ) but I needed php5.6. 在我的情况下,默认的php cli是php5.4( php -v输出),但是我需要php5.6。 Then I did 然后我做了

/opt/php56/bin/php composer.phar install

to install dependencies. 安装依赖项。

That's it. 而已。 If I want to use composer I used /opt/php56/bin/php composer.phar since. 如果我想使用作曲家,那么我就使用/opt/php56/bin/php composer.phar

您需要先运行作曲家才能拉出或安装依赖项

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

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