trying to run php artisan tinker returns error "file_exists(): Unable to find the wrapper "hoa" " - php

I'm trying to open tinker in a Laravel project, but when I run php artisan tinker I get this error:
ErrorException
file_exists(): Unable to find the wrapper "hoa" - did you forget to enable it when you configured PHP?
I can't find everything similar error online, I found only similar errors but with 'wrapper http' .
Does anyone have any suggestions? Thanks

Could this be due to custom code or a library you've imported?
I often find that if I add things to the ServiceProvider or Kernel, they run before many of the artisan commands, and if I've failed to perform the proper "if" checks first, it fails.
I suppose the question I would have in return would be; Is this a fresh Laravel install or have you got custom code and libraries running? I would check there, try removing libraries you've added, HOA from my searching doesn't appear to default to Laravel.
— Happy to revise my answer should more detail be provided

Solved with this command founded on github:
composer require psy/psysh:0.11.2 --dev

Related

VS Code can not reach Symfony\Component and Symfony\Bundle

I am trying to create a simple symfony project.
I run this on console:
composer create-project symfony/skeleton myProjectName
php -S 127.0.0.1:8000 -t myProjectName/public
Project succesfully run at localhost:8000. However, when I begin to inspect the code, I realized VS Code editor is indicating "Undefined type" error in projectDirectory/src/Kernel.php file. Do you have any ideas why this happens and any suggestions towards solution?
I use PHP v7.4.32 and Symfony 5.4 for development. My helper extentions are PHP Intelephense v1.8.2 and PHP IntelliSense v1.0.11.
projectDirectory/src/Kernel.php
The Error
Since it runs succesfully on browser, I dubted that the classes exist somewhere but the VSCode could not solve the relative paths. Then, I tried a couple of extensions. Installation of PHP v1.22.11089 created by DEVSENSE and PHP Namespace Resolver v1.1.9 created by Mehedi Hassan has solved the problem.

Laravel 5.2: Class log does not exist in /vendor/laravel/framework/src/Illuminate/Container/Container.php:734

I had to clear config and cache, I ran into the following exception :
PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /html/project/bootstrap/cache/compiled.php:1355
I removed bootstrap/compiled.php and ran php artisan clear-compiled, Then the exception got changed a little bit.
Class log does not exist in /html/project/vendor/laravel/framework/src/Illuminate/Container/Container.php:734
Steps i took to solve it :
Checked env for spaces and syntax errors, Which had a blank space and i removed it, but still my php artisan commands are not working.
Ran composer update | Still not working
Some people associate the error with mbstring and php-mysql extensions which i both have.
Tried composer dumpautoload
What am i missing, How should be done ?
I think somewhere in your code there is a typo like this (note lowercase 'l'):
\log::info('test');
And that code is executed when artisan is executed, so, probably this is somewhere in your console commands, or maybe in some services used by console commands, or maybe some global configuration.
Anyhow, search for '\log::' or 'log::' (in top-level file without namespaces this would result in same error message), and you'll find it.

Clarity on the use of pragmarx/firewall package for Laravel 5.2

so I've just completed the install of antonioribeiro/firewall package for laravel, which essentially allows blacklisting and whitelist of IP address and countries.
I'm working through the section on Artisan Commands, but when i try to run 'php artisan firewall:whitelist country:za' I get the following error:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "firewall:whitelist" is not defined.
Did you mean one of these?
firewall:list
firewall:tables
I have done all the necessary installation steps outlined in the documentation.
What am i doing wrong ? should I be using this command elsewhere ?
I am aware that these can be manually entered into the DB, but this functionality would be great to have.
I managed to fix the problem:
SOLUTION: When you run 'php artisan vendor:publish' it creates a new file called 'firewall.php' in the config directory. This is where you set default options. Simply change 'use_database' to true and the Database specific commands will work.
firewall:blacklist
firewall:clear
firewall:remove
firewall:whitelist

Codeception Bootstrap Error - Given expression is not a regex

I just pulled in the latest version of Codeception using Composer and ran vendor/bin/codecept bootstrap and received the error when it tried to the Build Inital Guy Classes:
PHP InvalidArgumentException: Given expression is not a regex. In:
vendor/symfony/finder/Symfony/Component/Finder/Expression/Regex.php on line 77
It actually does seem to complete, but whenever I run vendor/bin/codecept run I also get this same error.
For reference i'm using:
Laravel Latest
Composter Latest
PHP 5.4.25
Thanks for the assistance.
As a workaround, you can disable xdebug for php5-cli.

Laravel 4 Commands stopped working suddenly

Back from vacation, and when I'm trying to run one of my previously working command:
php artisan list
Throws me:
[root#api2]# php artisan list
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Call to a member function getArgument() on a non-object","file":"\/var\/www\/html\/api2.alariscms.com\/vendor\/laravel\/framework\/src\/Illuminate\/Console\/Command.php","line":153}}
And I seriously cannot understand why this happens. I tried debugging the file that throws an error. It awaits argument:
InputInterface $input but it gets NULL
I don't know what can go wrong on a framework level to stop receiving the required object.
Any ideas where to start debugging from? Or I can reload configurations / update laravel via cmd?
Thanks
This is what I would do:
php artisan dump
composer dump-autoload
check for current Laravel version
and then go to that specific command and check for bug there.
Also, what kind of argument are you trying to pass to command ? Is that object - if so check where is implementation of that class ?

Categories