symfony 5.4 and doctrine : SQLSTATE[HY000] [2019] Unknown character set - doctrine

i managed to read a book on symfony 5, but i am stuck where the book begins to talk about databases. i 'v been adding this to the .env file:
DATABASE_URL="mysql://amaury:pma#localhost/paracaidismopucon?serverVersion=8&charset=utf8mb4_unicode_ci"
where paracaidismopucon is my database.
then when i type:
php bin/console doctrine:database:create -vvv
i get the following error:
In ExceptionConverter.php line 117:
An exception occurred in the driver: SQLSTATE[HY000] [2019] Unknown character set
In Exception.php line 28:
SQLSTATE[HY000] [2019] Unknown character set
In Driver.php line 28:
SQLSTATE[HY000] [2019] Unknown character set
doctrine:database:create [-s|--shard SHARD] [-c|--connection [CONNECTION]] [--if-not-exists]
i am a newbie working with symfony...
please help!
i tried to go on different websites to solve my problem

Here is the docs to configure doctrine with multiple databases. I hope that could helps you.
May be the error is caused about that "&charset=utf8mb4_unicode_ci", try to remove it.
DATABASE_URL="mysql://amaury:pma#localhost/paracaidismopucon?serverVersion=8"

Related

I cannot migrate database in Laravel . it says SQLSTATE[HY000] [2002] Operation timed out

**These are related images **
https://i.stack.imgur.com/jAE1i.png
https://i.stack.imgur.com/jJGIR.png
https://i.stack.imgur.com/LBLkW.png
Why in .env DB_HOST=27.0.0.1 ? Maybe 127.0.0.1 works better ?

in facade.php 221, call to undefined method MySqlBuilder::defaultStringLenght()

in windows command promt full eror it gives same with some php artisan commands
C:\xampp\htdocs\jj>php artisan migrate
In Connection.php line 664:
SQLSTATE[HY000] [1049] Unknown database 'juwelleryjournal' (SQL: select * from information_schema
.tables where table_schema = juwelleryjournal and table_name = migrations)
In Connector.php line 67:
SQLSTATE[HY000] [1049] Unknown database 'juwelleryjournal'
, & php artisan make:"blabla" works well
If you encounter same error, latest windows php version could be an option for you, but it helped only my classmate, not me. The i found on already being in stack overflow (Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultStringLength()) and didn't help either. This occurs same on laptop(win7) and desktop pc(win10). I have laravel5.5.28 on both.
Have anyone any suggestions?
Add this to your AppServiceProvider
use Illuminate\Support\Facades\Schema;
function boot()
{
Schema::defaultStringLength(191);
}
Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultStringLenght()
=> the method name is wrong, it should be defaultStringLength

migration Rollback error class not found in Laravel

Trying to Rollback but its giving me error that class'task' not found. Can someone please tell me why I am getting that error,
I also tried to remove the schema drop line but still its giving the same error
In your command line run:
composer dump-autoload

Laravel 5 and iPage Hosting

I have a shared hosting at iPage. I did the steps listed here : Deploy Laravel 5 using only FTP in a shared hosting (Moving files, editing htaccess) and yet still facing the same 500 error :
20161126T060216: bluepenlabs.com/projects/peugeot/public/index.php PHP
Warning:
require(/hermes/bosnaweb28a/b1452/ipg.bluepenlabscom/projects/peugeot/public/bootstrap/autoload.php):
failed to open stream: No such file or directory in
/hermes/bosnaweb28a/b1452/ipg.bluepenlabscom/projects/peugeot/public/index.php
on line 22 PHP Fatal error: require(): Failed opening required
'/hermes/bosnaweb28a/b1452/ipg.bluepenlabscom/projects/peugeot/public/bootstrap/autoload.php'
(include_path='.:/usr/local/lib/php-5.5.22-amd64/lib/php') in
/hermes/bosnaweb28a/b1452/ipg.bluepenlabscom/ 20161126T061559:
bluepenlabs.com/projects/peugeot/public/index.php
PHP Parse error:
syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE)
in
/hermes/bosnaweb28a/b1452/ipg.bluepenlabscom/projects/peugeot/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
on line 475
20161126T061939: bluepenlabs.com/projects/peugeot/public/index.php PHP
Parse error: syntax error, unexpected '.', expecting '&' or variable
(T_VARIABLE) in
/hermes/bosnaweb28a/b1452/ipg.bluepenlabscom/projects/peugeot/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
on line 475
Note that i'm trying to install the laravel project in a subdirectory /projects/peugeot/
Thank you
I once hosted a laravel project on iPage(shared hosting). I faced 500 errors. Not showing much description.
This may be because of the Laravel 5.3 min server requirements.
Ipage hosting site normally give a version below the min requirement. You need to change the setting on your Control Panel. Try upgrading your PHP version.
Hope this helps.

Debugging a Laravel 5 artisan migrate unexpected T_VARIABLE FatalErrorException

When running artisan migrate on a Laravel 5 project, it is failing with the following FatalErrorException:
$ artisan migrate -vvv --force
[Symfony\Component\Debug\Exception\FatalErrorException] syntax
error, unexpected '$table' (T_VARIABLE)
How do I get the file and line that is causing the error?
If in anyway relevant, I'm on a Windows 7 x64 machine with WAMP - PHP 5.6 and Laravel Framework version 5.1.10 (LTS).
There might be a semicolon or bracket missing a line
Check all in your migration files.
Laravel is configured to create daily log files for your application
which are stored in the storage/logs directory.
http://laravel.com/docs/5.1/errors#logging
This class Symfony\Component\Debug\Exception\FatalErrorException has some differences compared with the other Exception classes and it is not properly presented by the "error renderers" or "error notifiers".
A New sentry "error notifier" ("getsentry/sentry-php" version >= "2.0") will give you a proper stack trace.
Here is issue where is reported : https://github.com/getsentry/sentry-php/issues/761
Here is the PR for fix : https://github.com/getsentry/sentry-php/pull/763

Resources