I'm developing an application in laravel, I have completed it on localhost, but when I run it on test server it shows me error
Class 'Collective\Html\HtmlServiceProvider' not found
I think it need to update composer. But how do I do it on test server..!
Please help me I'm new to laravel and web hosting.
Thank you.
You have to do a
composer install
you have 3 options
Copy /vendor folder via FTP - simple
Install and run Composer via terminal - can be forbidden
Run composer update from PHP
This is complete solution for 3. with description.
https://stackoverflow.com/a/38396047/2583652
code here: https://github.com/whipsterCZ/laravel-libraries/blob/master/public/composer.php
Related
I am trying to ask the question as precisely as possible but I myself have lots of confusion about this. So please bear with me
Problem - We have a third party API (Recurly) installed in our site. That site was built with Laravel. The version of that API is now outdated and I want to update the version via composer.
From the Recurly I have got the following instruction to upgrade the version
In composer.json file update the line of code from "recurly/recurly-client": "2.8." to "recurly/recurly-client": "2.12. . And this will upgrade your client library AND your API version.
Once you do this, please run a composer update in your terminal->active directory w/ Recurly and it will update you:
I have updated the line inside composer.json file. But I dont understand the second part of the instruction. How to run a composer update. Shall I update the composer itself? But I want to update the Recurly API version. is it necessary to update the composer itself?
I have found this link: https://getcomposer.org/doc/03-cli.md#update-u
In this link its written
In order to get the latest versions of the dependencies and to update the composer.lock file, you should use the update command. This command is also aliased as upgrade as it does the same as upgrade does if you are thinking of apt-get or similar package managers.
php composer.phar update
I am not sure Is this the command I need?
Our webserver is with AWS. And we have WHM and cPanel installed to manage the web server.
I understand my question is not not precise as expected . but I cant figure out where to start actually. Please suggest me accordingly
As composer update command can create additional problem to the server hence i have run composer update only for Recurly as a root
composer update recurly/recurly-client
It is important to run the command from the directory where the composer.lock and composer.json files are
for an example if you have several sites under your server and if you run the command as root it may affect other sites as well.
To prevent that first you have to run
cd /home/websitefolder
then
composer update recurly/recurly-client
This way you can update only single package and it will not affect the rest of your site
There are two approaches to solving your problem,
Option A
as was stated, go to your composer.json and update the line
go to Terminal at the cpanel, should you not have terminal, use option 2
cd into your directory and run php composer update, (please before doing this, make sure to have a copy of your composer.json and the lock files.
Option B (No Terminal at cpanel)
Zip your directory and download
copy the file after unzipping to your wamp/xamp directory
edit the composer.json
and run php composer update (things can break here, I think the best is to run composer install rather than update)
zip and upload the file back.
I believe that should solve the problem
I'm a newbie studying how it works YII. I found this project interesting.
Yii2-simple-classified with app-advanced
https://github.com/deviardn/diadoo
I read the documentation but I do not know exactly what I should do to be able to test it on localhost.
I already have YII2 installed with composer.
what should I do?
Thanks for your kind recommendations.
The project looks new, the author should explain more. In general, usually I clone the project first
$ git clone https://github.com/deviardn/diadoo.git .
Install the project with composer
$ composer update // or install
Initiate the code with this command, and set it to Development
$ ./init
Initiate the database migration, if necessary
$ ./yii migrate
And lastly, give it a try from your browser, access the localhost.
I am using windows server 2008 os. i download composer setup.exe and install to my PC . when I try composer install . I getting an error:
'composer' is not recognized as an internal or external command,
eg:-
c:\xampp\htdocs\shop>composer install
'composer' is not recognized as an internal or external command,
operable program or batch file.
My environment variable PATH is shown below:
C:\xampp\php\;C:\Users\Administrator\AppData\Roaming\Composer\vendor\bin
For anyone coming here from Google who are facing the same issue. I just managed to solve this issue after all the other "solutions" other people suggested didn't work.
I installed Composer properly and the Environment variable was set but it just wouldn't work.
In my case composer is installed in C:\ProgramData\ComposerSetup\bin and this is exactly what is in my PATH Environment variable. After messing around a bit trying to fix it I saw that under System variables under PATH there is something called PATHEXT I opened that and added ;.PHAR to the end of it. So it ended up like this:
And this is what my PATH is now:
I closed all file explorer windows and command prompts and started a new CMD and ran composer --version and it worked!
I hope this helps someone facing the same issue as me.
https://getcomposer.org/doc/00-intro.md#installation-windows
Close your current terminal and open a new one.
I had the same problem, I kept repeating the composer installation until it was resolved this way:
1) Download the composer installer (.exe) and put it on C:/XAMPP.
2) Run the installer by just clicking next till the end.
3) Open command-line (cmd) and cd to your project directory (C:/XAMPP/htdocs/myproject) and type composer and see if you have it installed.
4) It should work now, let's say you want to install a PHP framework from your project directory: cmd=>composer require slim/slim "^3.0".
I had the same problem .
In my case i used the command "php composer.phar " instead of "Composer " and it worked .
just paste " echo #php "%~dp0composer.phar" %*>composer.bat " This in your Terminal where you install composer and Boom you get the solution.
The solution is to use complete composer path instead of composer install
eg:- C:\ProgramData\ComposerSetup\bin\composer install" instead of "composer install
Better still, add "C:\ProgramData\ComposerSetup\bin\" to your environment variables, so that you can use "composer install".
If u can't find composer file than follow only 2 steps
1- Download composer file from [https://getcomposer.org/download/]<click on Composer-Setup.exe>
2- Install above file at your project root dir. and give second path is your php.exe file and finally solve this issue.
Simply use
like this
C:\jay\xampp\htdocs\zoho1>php composer.phar require zohocrm/php-sdk
You Just Don't need to worry about this if you have installed composer using Command-line installation than this problem will occurs.
So my suggestion is to download .exe file by visiting this link https://getcomposer.org/
And also after download using this link you don't need to use php composer.phar instead of composer only
I was facing the same issue in installing the composer command in cmd but when I closed all windows file explorers and again run this command "composer global require laravel/installer " from "**https://laravel.com/docs/8.x**". It just installed without any error
remove all your playings with composer path in path variable
go to https://getcomposer.org/doc/00-intro.md#using-the-installer
and find Composer-Setup.exe link to that exe.
I can solve this problem easily without do anything.
Suppose I'm going to create a project in my desktop and facing the problem which you have shown in the description. now follow the step.
Project folder on desktop
Step 1: go you your CMD(Command Prompt) of your Computer
step 2:Select the folder by command here like image (cd/desktop/example folder)
Step 3: After select the folder now write the command which you want to do like screenshot . you can see Im writing the command for laravel.
done, just easy step you can work anything from here and you can see downloading and being prepare for the project
I am Using my own Machine Kali Linux 2.0 Debian x64 . Now, i have Installed Laravel in my directory structure like
/opt/lampp/htdocs/learning-larvel/
Inside the Learning-laravel folder i have Installed my Laravel files, and also i installed composer. So when i go to http://127.0.0.1/learning-laravel/public . I see a See a White Screen and in Between it is written "Laravel 5", which means the Laravel GUI Setup is fine.
Now, to create a new file for Laravel, when i open my Terminal and type
laravel new xyz
then it gives me a error which says bash: laravel: command not found
Now, how can i fix the error.. I have researched about it by setting PATH to bashrc. But i am not getting it fixed right. Additionally when i type in my command composer -version then also it says bash: composer: command not found but i have Installed composer on the folder learning-laravel itself.
I could also see files like composer.phar there in /opt/lampp/htdocs/learning-larvel/
Any help would be extremely thankful.
As the composer official getting started page points out:
There are in short, two ways to install Composer. Locally as part of
your project, or globally as a system wide executable.
if you wanna do composer -- or laravel -- in command line, you wanna install them globally.
Check out the following links:
https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx
https://laravel.com/docs/4.2#install-laravel
I encountered the same problem. Apparently, the composer exists in path ~/.config/composer/vendor/bin when running as super user. Therefore, replacing the paths which were described above by this, and it should work. Hope it helps.
i am lost...
i am trying to do it the right way and am following the Quick Start Guide for installing cakePHP 3 on my ubuntu machine.
Got composer installed. Directory is /var/www/cakephp
and am trying to issue:
php composer.phar create-project --prefer-dist cakephp/app mayapp
or
composer create-project --prefer-dist cakephp/app may app
then i am simply getting:
[InvalidArgumentException]
Could not find package cakephp/app with stability stable.
i do not have a clue what i am doing wrong. Any suggestions?
cakephp/app exists on https://packagist.org, and the command looks ok to me.
Which PHP version are you using? That package is only available with PHP 5.4.16 or later, so you must update if you want to use CakePHP.
However, it is a good idea to only use the same PHP version of your public hosting, using a newer version will lead to problems when deploying your code. If your webspace or public server does not have the latest PHP 5.6 running, ask for an update.
I got same issue. But, as previous answer, myapp does not exists on packagist.org, so, you must use laravel/laravel instead, and, after created, rename the new laravel folder to your desired name and move to htdocs (for xampp) or www (for wamp), then, and I do not know why, go to : localhost/laravel/public/
and replace laravel with the name you gave to your project folder instead the laravel one.
You will see Laravel 5 fonts will appear on screen.
That's means Laravel is running.
Hey Please try these steps.
Download XAMPP Server.
Install XAMPP server.
Go to ..\xampp\php\php.ini and open.
Add this line (extension=php_intl.dll) or if exist uncomment.
Download Composer setup from https://github.com/composer/windows-setup/releases/
Install composer and give php.exe file in path
Open cmd and check now php version using command php -v. if its showing php version its means its working.
Now open cmd and cd on xampp\htdocs folder & run command composer create-project --prefer-dist cakephp/app app_name
Finished folder created in htdocs.
Hope this is helpful for you.