Symfony : Wrong path when generating entity on Linux Ubuntu - ubuntu-20.04

On Symfony 5 I've got an issue when generating an entity on a subdirectory on Linux Ubuntu 20.04 (don't have this issue on Windows). I use PhpStorm.
For example I generate an entity Event\Category so I do :
php bin/console make:entity Event\Category
And instead of generating my entity like src/Event/Category.php I get this result:
src/EventCategory.php
Does someone know how can I fix it? Thank you.

try to use
php bin/console make:entity Event\\Category
\ is the bash a special Charater, with -double you escape that

Related

artisan not working in laravel 5.2 returning [ErrorException]

I'm getting problem when trying to execute php artisan "command". Does not matter the command.
For example, executing the command:
php artisan make:controller TestController
I have got the following result
[ErrorException]
Undefined variable: ths
What I have tried to do?
I have tried to update/install composer
composer update
composer install
composer dump-autoload
It's causing me a lot of problem for example I can't execute my migration in another words I can't take the next steps.
Would be great if someone has some idea how to fix that.
Thank's a lot
This error means that somewhere you have a class with $ths variable and it's not related to commands. I think you wrote some code and used $ths instead of $this. Check all last changes (custom commands, facades, service providers etc). Just fix it and commands will work again.
If you can't find $ths in your code, check Laravel error logs for extra info.
I suggest finding this in your code. If you use Sublime Text press:
The keyboard shortcut is Ctrl⇧+F on non-Mac (regular) keyboards, and ⌘⇧+F on a Mac.
And put $this on this variable instead of $ths

"Full REPL not supported. Falling back to simple shell" - error in Laravel While Trying To Use php artisan tinker

My Development Environment:
Windows 7 + WAMP
PHP Version: 5.4.16
While I try to use php artisan tinker - my console give me the following error:
REPL not supported. Falling back to simple shell
I search solution for this and found this :
Full REPL not supported
But this could not helped me much.I know Boris is By default supported by laravel 4.1.
And I might do some changes in php.ini according to this.
If the tinker command doesn't work for you, it is very likely the disable_functions setting in your php.ini contains the needed pcntl_() functions. Put a comment before this line in your php.ini and that should allow tinker to work.
Source :http://laravel-recipes.com/recipes/280
But when I Open my php.ini file the disable_functions contains nothing except this:
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. This directive is
; NOT affected by whether Safe Mode is turned On or Off.
; http://php.net/disable-classes
Is this My WAMP problem? Do I Missing Something !!!
Boris In Tinker
The php artisan tinker command now utilizes the Boris REPL if your system supports it. The readline >and pcntl PHP extensions must be installed to use this feature. If you do not have these extensions, >the shell from 4.0 will be used.
From the Laravel docs here:
http://laravel.com/docs/releases
So basically, they are telling you that php55-pcntl and readline needs to be installed.
Everytime I try to brew install php55-pcntl though, I get
configure: error: Cannot find openSSL's <evp.h>
Try running that and see what you get.
UPDATE: Use Laravel's Homestead environment
I completely gave up trying to run it on a XAMPP/WAMP/MAMP-style localhost.
If you go to the quickstart docs and scroll down to local development environment:
http://laravel.com/docs/quick#local-development-environment
It actually recommends you use Laravel's custom homestead environment:
http://laravel.com/docs/homestead
Read the docs for installing that and report back with results. It has been working perfectly for me.
One or more of readline posix and pcntl extensions are missing. You need to compile PHP with the appropiate configuration options to enabled it.
Here are the instructions:
readline http://www.php.net/manual/en/readline.installation.php
pcntl http://www.php.net/manual/en/pcntl.installation.php
posix http://www.php.net/manual/en/posix.installation.php
Note that posix functions are enabled by default.

phpunit command return "phpunit --help" screen

I'm trying to make some PhpUnit test on Magento with using ecomdev (https://github.com/EcomDev/EcomDev_PHPUnit).
I've correctly installed modman, PEAR and related packages dependencies (I'm on Ubuntu server 12.04 through a Virtualbox).
What is really strange is, after the step 2, from ecomdev procedure, when I'm trying to start a first "$ phpunit" command, it shows the screen as if I typed "$ phpunit --help".
When I type "$ phpunit --version" it correctly displaying the current version (mean it seems correctly installed).
All advices are welcome.
I have been similar problem on WAMP, WinXP SP3, Apache 2.4, PHP5.4.44, Xdebug v2.3.3, vc10+vc14
I downloaded phpunit.phar from phpunit.de
My error was wrong phpunit.cmd file.
I wrote
#php "%~dp0phpunit.phar"
Correct cmd is
#php "%~dp0phpunit.phar" %*
phpunit needs to know what to run. EcomDev_phpUnit includes a phpunit.xml.dist file that phpunit can use. Neither modman nor modgit installs it in Magento's root by default. You can copy the default version into Magento's webroot from the module's source folder or by installing the module manually.
I used modgit to install EcomDev_phpUnit. Here is the copy command I used to copy the file:
cp .modgit/ecomdev_phpunit/source/phpunit.xml.dist .
Once in place, phpunit should give you something like this:
$ phpunit
PHPUnit 3.7.28 by Sebastian Bergmann.
Configuration read from /path/to/your/magento/phpunit.xml.dist
There is likely a more correct way to use the included ecomdev-phpunit.php script to copy the phpunit.dist.xml file into place.

cannot install or use ZeroMQ library

I am working on Debian Linux / Apache (a VPS at Dreamhost). I have tried to install ZeroMQ (version 3.2.3) as per these instructions. At the first glance, it looks like everything went well.
The sudo make install command proudly reports back that (among others)
Libraries have been installed in: /usr/local/lib
Indeed, here is the ls of /usr/local/lib:
libzmq.a libzmq.so libzmq.so.3.0.0 php python2.5 site_ruby
libzmq.la libzmq.so.3 ocaml pkgconfig python2.6
In order to use ZeroMQ I have added to my php.ini:
extension = /usr/local/lib/libzmq.so
But when I run PHP, I get:
PHP Startup: Invalid library (maybe not a PHP library) '/usr/local/lib/libzmq.so
What am I doing wrong?
update
As per djf's answer, I worked my way through the instructions for PHP bindings (building from Github). Those seem to work. But then, when I run PHP I get:
PHP Warning: PHP Startup:
zmq: Unable to initialize module Module compiled with module API=20060613
PHP compiled with module API=20100525
These options need to match in Unknown on line 0`
Now what?
update 2
Oh, wait a minute. I may know what that is. Dreamhost has PHP 5.2 on the command line. I need PHP 5.4, so I have been calling PHP like so /usr/local/php54/bin/php (this is apparently where the PHP 5.4 executable resides).
However, commands like configure and make use the ordinary, standard PHP. So I needed to upgrade CLI PHP to 5.4.
After that, everything worked. Thanks for the help, everyone!
Seems like you've only installed the C library, hence the error:
PHP Startup: Invalid library (maybe not a PHP library) '/usr/local/lib/libzmq.so
You also have to build the PHP bindings. Check these instructions on howto build them.
I do this for windows but i thinks linux is same.
Just go to http://pecl.php.net/package/zmq/1.1.2/windows and download package that fit with your php version.
Then extract it and coppy 'libzmq.dll' to 'xampp/php' folder, 'php_zmq.dll' to 'xampp/php/etc'.
At the end of 'php.ini' add following line:extension=php_zmq.dll
Don't forget restart your xampp!Good luck

Installling phpunit mac osx snowleopard (zend framework)

I'v been trying to get phpunit up and running but for some reason i'm stuck with the following error:
Warning: require(PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 44
Fatal error: require(): Failed opening required 'PHPUnit/Autoload.php' (include_path='.:') in /usr/bin/phpunit on line 44
Does anybody have a clue how to solve this?
Thanks in advance!
Peter
Your include path is not setup. Follow the instructions at http://pear.php.net/manual/en/installation.checking.php
Also check if you installed phpunit in the correct directory:
$ pear list-files phpunit/phpunit
PHPUnit/Autoload.php should be listed there, in the patch you added to the include path.
Update: the problem was that #Peter had 2 php.ini files, and he edited the wrong one.
Find the correct one with
$ php --ini
Irakli's post was the most helpful.
I'm on Mac OS X 10.7.2 and I use Homebrew to install packages. Homebrew put php in /usr/local/bin/php.
Following Irakli's hint that phpunit is using a different version on of PHP (even though it was using the same php.ini file), I edited /usr/bin/phpunit, replacing this:
#!/usr/bin/php
with this:
#!/usr/local/bin/php
(Irakli's suggestion of "#!/usr/bin/env php" didn't work for me)
Now phpunit can find "File/Iterator/Autoload.php" which is was having trouble with before, so I guess it's in the path now.
On Mac Lion I added the include path:
/usr/lib/php/pear/
to /private/etc/php.ini which solved the error.
In some cases (e.g. when using brew-installed PHP on OS-X Leopard/Snow Leopard/Lion) the problem can be that there're multiple php versions installed and phpunit is picking wrong one.
There's an easy solution, sudo-edit /usr/bin/phpunit and replace #!/usr/bin/php with #!/usr/bin/env php
Somebody should probably submit a bug to phpunit, referring to PHP executable directly is really careless.

Resources