Nova on Laradock raises bcadd exception - laravel

I have a simple installation of Laravel with Laradock.
When I try to update a model, there is no problem.
However, when I install Nova and try to update some model (for example user name), I get the following error:
Looking at ajax call, I see the following error:
exception: "Symfony\Component\Debug\Exception\FatalThrowableError"
file: "/var/www/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php"
line: 506
message: "Call to undefined function Moontoast\Math\bcadd()"
I tried to set PHP_WORKER_INSTALL_BCMATH to true in .env and rebuild docker image, but it didn't help.
I also found this issue:
https://github.com/laravel/telescope/issues/25#issuecomment-432302285
But it didn't help me to solve the problem.

For anyone else experiencing this issue this is what solved it for me:
bin/bash into docker container and run
docker-php-ext-install bcmath
Then restart server. This helped for my case. I would expect analogical steps would work for Laradock.

Related

Codeigniter - Sparks to composer, activerecord issues now

So I have just gone through a update going from CI 2.0.4 to 3.1.4 and ran into the issue with Sparks now being redundant I've had to move onto composer to get php active record working..
however I have had autoloading issues/ Solved by including the model directly into the controller ie: require_once(APPPATH.'models/User.php');
But now im getting the following error..
An uncaught Exception was encountered
Type: ActiveRecord\DatabaseException
Message: Empty connection string
Filename: /var/www/html/vendor/php-activerecord/php-activerecord/lib/Connection.php
Line Number: 105
btw to load the composer autoload I've put: config['composer_autoload'] = '../vendor/autoload.php'; as the vendor directory sits outside the application folder in its parents folder.
Any help would be greatly appreciated..
You can move the vendor directory to your public_html/www and try
config['composer_autoload'] = FCPATH.'vendor/autoload.php';

Strange error with Symfony-2.8

I am using Symfony 2.8.18. I was always able to debug the previous error messages I had. I searched on Google for same errors but I did not find anything. Everything worked perfectly before. I restarted my local server and get the following error message:
Warning: class_implements(): Class �]� does not exist and could not be
loaded
Here is a link to the screenshot of the message: strange bug screenshot.
I deleted the cache by removing the corresponding folders and by using the following command:
php app\console doctrine:cache:clear-metadata && php app\console doctrine:cache:clear-query && php app\console doctrine:cache:clear-result
But it did not solve my problem. I do not know how to understand this error message.
Do you have any ideas on how to debug the code?
I did not change anything but it seems one or several files were corrupted. The solution was to:
Remove the vendor folder;
Run composer install.
My problem was solved by doing this.

Class log does not exist in F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php:738 Stack trace:

I ran config:cache in my Laravel 5.2 application and this error started showing up.
Fatal error: Uncaught ReflectionException: Class log does not exist in F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php:738 Stack trace: #0 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(738): ReflectionClass->__construct('log') #1 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(633): Illuminate\Container\Container->build('log', Array) #2 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(697): Illuminate\Container\Container->make('log', Array) #3 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(853): Illuminate\Foundation\Application->make('log') #4 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(808): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(7 in F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 738
I looked for many solutions. Nothing worked for me.
My .env file does not have any spaces
I deleted extra packages from my composer.json and ran composer update.
I ran php artisan clear compiled many times.
I looked for errors in my files but could not find any.
I also enabled the mysql extension since I found it somewhere. Then I did a fresh checkout of Laravel 5.2 and now the error is like this.
So, it's not a problem of any config file of mine. Its something else. Any of you have any idea?
Ok , so I solved it. Looks liek I had multiple issues.
In my fresh check out of laravel 5.2, where I was finding error about not having vendor/autoload.php file, I ran in the root directory in command window,
'composer update --no-scripts' , then 'composer update'. That solved the issue.
I also had to enable my mysql extension by editing php.ini file.
Finally, in my existing project, I actually found a problem in config/app.php. I missed a ',' somewhere. And people, laravel is a disgusting debugger. I miss my cakephp more.
It's a laravel 5 issue. Better to use laravel 4 still
Run this command:
php artisan dump-autoload
then composer update

PHP Fatal error: A precedence rule was defined for > Illuminate\Foundation\Auth\AuthenticatesUsers::getGuard

I've just finished updating an app from Laravel 5.1 to 5.2. Everything is working fine on my local Homestead install. When I deploy to my forge server, the process is failing with the following error:
PHP Fatal error: A precedence rule was defined for
Illuminate\Foundation\Auth\AuthenticatesUsers::getGuard but this
method does not exist in
/home/forge/myapp/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php
on line 11
What could be causing this? I've tried running composer dump-autoload after the update, but still no luck.
Any advice appreciated.
I fixed this by deleting /bootstrap/cache/compiled.php. The files the error refers to were fine.
The AuthenticatesAndRegistersUsers has a precedence statement to use getGuard from AuthenticatesUsers instead of from RegistersUsers.
The AuthenticatesUsers trait has a getGuard method defined in it.
Double check to make sure your version of that trait has the getGuard method and or double check those traits against the ones in the laravel repository.

LAMP Laravel ErrorException mcrypt_get_iv_size(): Module initialization failed

I installed laravel in my new pc and i'm getting this error:
ErrorException mcrypt_get_iv_size(): Module initialization failed
I copied the project from my old pc. mcrypt is installed and enabled, and other pages that do not use laravel are working. I'm running ubuntu 14.04
I created a new laravel project (using laravel new command) and when i try to access i get:
"Whoops, looks like something went wrong."
I opened the log and the error was:
production.ERROR: exception 'ErrorException' with message
'mcrypt_get_iv_size(): Module initialization failed
any ideas?
On app/config/app.php just change:
'cipher' => MCRYPT_RIJNDAEL_256,
Run php artisan key:generate on your command line to refresh your application key.
Then clear your cache and sessions and try again.
I had this same problem today, and it was because of how Laravel 4.2 uses the new encryption method.
Make sure you run php 7.0, and add this string "MCRYPT_RIJNDAEL_256" (without the quotes) to the cipher in app.php. after generate a new key (php artisan key:generate) and add the new key.
This works for me.
Another solution:
Add "tomgrohl/laravel4-php71-encrypter": "^1.1" to the require of your composer.json
Run composer update
Add 'AES-256-CBC' to the cipher in app/config/app.php
Done!

Resources