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.
Related
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.
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
I am trying to initialize php unit testing with my wordpress plugin using phpunit. I am running xampp on windows. My xampp installation is also on my E: drive if that makes any difference. I am following along with this tutorial:
https://www.smashingmagazine.com/2017/12/automated-testing-wordpress-plugins-phpunit/
I have gotten to the part where I run
install-wp-tests.sh wordpress_test root '' localhost latest
I run that and it pops up and closes quickly, so I don't know if it is really working or not. I then try to run
phpunit tests/test-sample.php
and I get:
PHP Fatal error: Class 'WP_UnitTestCase' not found in E:\xampp\htdocs\wp-content\plugins\SRBC\tests\test-sample.php on line 11
Fatal error: Class 'WP_UnitTestCase' not found in E:\xampp\htdocs\wp-content\plugins\SRBC\tests\test-sample.php on line 11
I assume that means the install-wp-test.sh isn't installing correctly and it is missing those classes. Any ideas?
Ended up needing to install SVN for windows. Also had to add the mysqladmin.exe path to the PATH environment variable. Then finally needed this :
https://wordpress.stackexchange.com/questions/249402/error-when-setting-up-phpunit-tests-with-wp-cli-scaffold
And after all that and 3 hours! I got it to work correctly!
Hope this helps someone else.
Few weeks ago I set up a Message system with Symfony Messenger and it worked great.
Today I wanted to create new object through message, so I went to my server and type the command to consume message
First I had this result
$ bin/console messenger:consume-messages amqp_notifications
/usr/bin/env: ‘php\r’: No such file or directory
It never happened before with my files, and I never changed the line ending or encoding of my file sin PHPstorm.
I tried to use $ php bin/console messenger:consume-messages amqp_notifications
but then I had this error.
Attempted to load class "AMQPConnection" from the global namespace.
Did you forget a "use" statement?
Pretty weird, because I have have the php-amqp ext installed as you can see on the screenshot of my phpinfo
I didn't change anything in my Message class or Handler.
Also, I tried to call new AMQPConnection() on a random action, just to try, and I didn't get the error.
I'm completely lost with this error this time, as everything is installed.
I use PHP 7.3.1 and symfony Messenger 4.2.2
It seems your second issue was already solved by ccKep on his comment.
The first one is that the specific shebang line #!/usr/bin/env php executes the first php found in the $PATH. So if you already have uninstalled it, which seems the case, or it has a symbolic link to another php version, you can get a wrong result.
Tries to check what is inside the $PATH and replace the PHP path for the correct one. You might get the place running which php.
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 ?