App using Laravel 5.2. not working > 'GuzzleHttp\Client' not found - laravel-5

I have App running on Laravel 5.2.
It works fine until it tries to send emails through MailGun, and shows this error : Web App Error
When I try to add Guzzle through SSH, I have this error below :
Guzzle CLI Install Error
I'm lost, because I don't know much of Laravel, may anyone please help !

You have to install Guzzle as required by Laravel documentation.
The API based drivers such as Mailgun and Mandrill are often simpler and faster than SMTP servers. All of the API drivers require that the Guzzle HTTP library be installed for your application. You may install Guzzle to your project by adding the following line to your composer.json file: "guzzlehttp/guzzle": "~5.3|~6.0"
Then you have to run a
composer update
Or you can simply run in terminal
composer require "guzzlehttp/guzzle": "~5.3|~6.0"

The reason you are getting this error is because Guzzle has not been installed in the first place because you are getting an error when trying to install it via composer.
Could not scan for classes inside database which does not appear to be a file nor a folder
It seems that you are trying to load classes that are present in your composer.json file but not in your project directory.
Open your composer.json file, you should see something like this:
"classmap": [
"database", /// <--- this line or similar
],
You should first fix this error before running composer install again.

Related

Laravel black page - Unable to create configured logger. Using emergency logger [duplicate]

So.. I developed a project with Laravel 9, then I had to upload it to my client's server by FTP ( which was slow and painful ) to find out only afterwards that my client's server PHP version could not go over 8.0. I tried to open the project live link ( to where I uploaded ) and the composer platform check was telling me my project had dependencies on PHP 8.1 and that my version is 8.0.
So I tried tweaking the platform check php file to disable this check, to see if it would work anyways but no, the project was throwing errors.
So I decided to downgrade to laravel 8, because after searching around I read that laravel 8 did not need php 8.1.
I guess I read some wrong information because after tweaking my project to downgrade to laravel 8 and uploading again (painfully by ftp), the platform check was again telling me that my project needed PHP 8.1.
So I disabled again this platform check by editing/tweaking the platform check php file, to see if it would work anyway, and it did work. So all good. but then today I was learning how to check which composer packages had dependencies on a specific php version, and in the process I found out (if I'm not wrong) that laravel 8 has package dependencies that depend on PHP 8.1 ?
Is there a table somewhere I can check which Laravel versions depend on which PHP versions or do I have to run some commands on each project to check these dependencies?
Like in the images below:
Thanks !
Laravel 9 does not require PHP 8.1 it requires PHP 8.0.2
If this a shared project and someone else with PHP 8.1 generated the composer.lock file (or indeed you locally have PHP 8.1 but the server has 8.0) you might end up with packages that require PHP 8.1. Composer resolves and installs packages based on the locally installed PHP version.
You can override this behaviour and ensure everyone gets package deps based on the PHP version you expect to have on production if you use the platform config option in your composer.json e.g. add this to your composer.json
"config": {
"platform": {
"php": "8.0.2"
}
}
Then run
composer update
this should try to fix your package versions to ones that work with PHP 8
Short response no, Laravel 8 requires PHP >= 7.3
From Server Requirements
But, since you downgraded it is possible that some php packages require newer php versions no matter the version chosen for Laravel.
Some hints:
Change dependencies (packages) version, probably downgrade them.
Delete the vendor folder.
Delete composer.lock
Run composer install
Checking your screenshot: with symfony the downgrade will not break anything.
But, check the other package/s ie: tojsverkoyen/css-to-inline-styles requirements.

How to setup the Shopware development template without docker? (to provide a Shopware platform pull request)

I understand, that in order to contribute to the Shopware platform / core, I have to setup Shopware 6 using the development template.
I followed the steps at
https://github.com/shopware/platform#quickstart--installation
But only until
./psh.phar docker:start
I was thinking about installing via bin/console system:setup and bin/console system:install but it fails with
PHP Fatal error: Uncaught Symfony\Component\Dotenv\Exception\PathException:
Unable to read the "/home/projects/shopware-dev-bd/bin/../.env" environment file. in
/home/projects/shopware-dev-bd/vendor/symfony/dotenv/Dotenv.php:567
Is there an easy way to create the .env? Do I have to copy it manually?
It is recommended now to use the platform repository directly for setting up development installations.
Just clone directly from shopware/platform
composer install
bin/console system:setup to create the .env file
composer run setup
optionally bin/console framework:demodata if you need demo data
Addition to the accepted answer:
While in the development template there was psr.phar to manage things like building the admin theme, and in production template there is bin/build-administration.sh none of those are there in the method described by #dneustadt.
Instead this is managed by composer scripts which are defined in the composer.json
For example admin JS is build using
composer run build:js:admin

Compiled Services Class Has been removed Composer error laravel 5.4

Dears whenever i want to add any Packeg using composer i face below error
"Compiled Services Class Has been removed"
I search many solution like "composer update" etc but still i face this problem
due to this error my working is stop.
kindly help me whats the original solution.
thats the composer installation problem? or what ?
The message The compiled services file has been removed. is a info message from the clear compiled command: php artisan clear-compiled.
It is called from php artisan optimize that runs on every composer update or install.
The message is only a info reporting that the file bootstrap/cache/services.php has been removed.
The services.php file will be reconstructed at the next request.
So at the end its a normal info message.
I have encountered the same problem.
Just remove the "Vendor" folder then install the composer. It worked fine for me.

Class 'Stripe\Stripe' not found error in PHP

I installed laravel and composer and created my first project in laravel. I want to integrate stripe using PHP. When I try to execute my first project in localhost I take this message:
Fatal error: Class 'Stripe\Stripe' not found in C:\xampp\htdocs\laravel\stripe\public\elda.php on line 21
To include the stripe libraries, I inserted inside the composer.json file the code from the API library for PHP. Here is an image of my composer.json file:
I run composer install in cmd and this is the output:
You may be getting outdated dependencies. Run update to update them.
I run composer update and the output is the error in the image below:
Can someone help me to solve this error?
Well, sorry did not make a comment of your post, but I have not enough points to do so. But you need to run composer install in the terminal after that includes a new package.
I had the same issue, but when I ran this command my issue is resolved.
composer require stripe/stripe-php
I hope this may help you, after you update your composer.

Laravel 4 class not found after doployment to production

Error:
Class 'App\Package\PackageServiceProvider' not found
After moving my laravel directories to my server. The app is under psr-0.
The same files are found and working locally without any errors.
I tried to update composer with and without dump but nothing changes.
Why does that happen?
By default, the vendor directory is not checked into your git repository. So, just run composer install on your server and it should take care of the rest.

Resources