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

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.

Related

TYPO3 8.7 Install an extension without composer

I have a T3 8 project that was installed WITHOUT composer.
For the project I need the Ext t3api, which can only be installed (???) WITH composer.
Is it possible to install it somehow?
EXT:t3api is available via TER (https://extensions.typo3.org/extension/t3api). So it's installable via extensionmanager.
Another way would be uploading the extension's folder to typo3conf/ext/ (foldername = extensionkey - in this case "t3api"). Then the extensionmanager will find it and allow you to active/install it.
Update:
Dependencies to PHP packages (like some symfony/* packages) cannot be handled directly by TYPO3 (ext_emconf.php). Therefore, you have to build your own extension with the code of these packages and configure the appropriate autoloading.
There's already a good thread "How do I install Composer PHP packages without Composer?"

Laravel sail not supported dependency error [duplicate]

We are using PHPCI and composer. The server which runs PHPCI is on PHP 5.3.
For a project we added the Facebook PHP SDK, using composer. It requires PHP 5.4.
Composer gets triggered by PHPCI and get executed. But because the CI server just got PHP 5.3 composer failed with the error message:
facebook/php-sdk-v4 4.0.9 requires php >=5.4.0 -> no matching package found.
This let fail my build in PHPCI, of course.
Is there a possibility to skip this requirement? Maybe by adding an option to composer.json? Or a parameter to composer.phar call?
I've found the option:
composer install --ignore-platform-reqs
Ignore platform requirements (php & ext- packages).
Alternative: Specify your projects' PHP version
You can skip the platform checks by configuring composer.json#/config/platform/php with the PHP version to use.
Composer will fetch packages based on that configured PHP version then.
So when you need to tell Composer the PHP version for your projects dependencies, you can (and should) specify the PHP version if different than the PHP version you execute composer with in your composer.json project configuration file (AKA root package):
{
"config": {
"platform": {
"php": "5.6.6"
}
}
}
Here PHP 5.6.6 version is exemplary, it could be 8.0.4 or any other PHP version.
This also documents the target (platform) PHP configuration. Additionally installed PHP extensions and library versions can be specified.
Compare: Config: platform - Composer documentation
For many commands, you can tell composer to bypass php version check, with parameter "--ignore-platform-reqs":
composer COMMAND --ignore-platform-reqs
this will bypass php version specification.
Be aware that the software may work or not: php version specification is there because somewhere in the code is needed at least the specified php version, so if you use that code the software will break.
If anything requires a specific version of PHP, it won't run in a lower version of PHP. You will properbly still recieve errors when bypassing the PHP requirement.
Btw, PHP 5.3 is no longer maintained, I would strongly recommend updating the PHPCI server.

Installing Composer and Packagers - first time

I have never used Composer, but I want to use PHPSpreadsheet package, and it is recommended that Composer is used.
I am on a MAC using XAMPP and Netbeans.
I have installed Composer, and I have run the following command to get and install the PHPSpreadsheet package.
php ../../Composer/composer.phar require phpoffice/phpspreadsheet
I am running this in my project folder, (hence the ../../ to where Composer.phar is located.
This downloads the files into a vendor folder in my project folder.
What should I do then? Do I need to keep it in the Vendor folder, or can I move into a folder of my choice?
Netbeans has Composer options in the menus, but as far as I can see, this is for creating dependencies rather than installing packages.
I know I am totally missing the point of Composer somewhere, but have spent hours just trying to get this work.
Many thanks
You should really start with the docs -> https://getcomposer.org/doc/01-basic-usage.md
You have to keep the vendor directory - this is where all dependencies are kept. If you require more packages - then they will be installed in that directory.
After requring the package you have to load it so the PHP will know all the classes. Composer comes with great autolader. It is located by default in vendor/autoload.php. So what you have to do now is to require this file in your project. After that all classes from composer packages will be loaded automaticaly each time you use them in the code :)
I hope this will help you with this great tool. Cheers.

Error when changing PHP version on Heroku app

As some of you might know, PHP version ≥7.2 has an issue regarding count: count(): parameter must be an array or an object that implements Countable and this does contributes to a lot of problems.
I'm using the PHP framework Laravel 5.3 on Heroku, which until the change of PHP version worked perfectly fine. So why don't I just change the PHP version? Well, according to the docs I'm supposed to just change the version in my composer.json, run composer update and everything will be fine but no - I'm getting this error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- This package requires php ^5.6.4 but your PHP version (7.2.1) does not satisfy that requirement.
Anyone knowing anything that can contribute solving my problem?
You also need to push composer.lock.
Change the version in your local and make $ composer update.
Make sure you have changed composer.lock.
Push both files on Heroku.
From the documentation, https://devcenter.heroku.com/articles/php-support#php-runtimes
Next, ensure that your new requirements are “frozen” to composer.lock
by running:
$ composer update
Finally, don’t forget to git add and git commit both files!
Hope this helps.

how to safely update way generators 3.0 package in laravel 4.2

i figured out too late that way generators version 3 package is not compatible with laravel version 4.2 it only work with laravel 5, now i need to switch to a previous version of the package and i do not know how to do it properly as my laravel project is in the half way.
Thank you so much for any further help
Update your composer.json file to use "way/generators": "~2.0". Once that is done, run the following command:
composer update "way/generators" --dev
By providing the package name to the composer command, composer will only update the specified package.

Resources