I’m working on a Symfony project and would like to know why whenever I run the following command in terminal php bin/console server:run it would be immediately followed by this one composer require symfony/mailer. This is a screenshot of terminal: Moreover, this is what I get as an output on http://127.0.0.1:8000/: You can notice that the command text “composer require
Tag: command-line
Running PHP commands gives Xdebug errors
I’m currently getting some weird error messages whenever I run which php or php –ini: I currently have 4 php versions in my /usr/local/etc/php folders: currently using php7.3 as my default php version. I’m planning to remove older php versions if that doesn’t cause much trouble. Can someone explain why such error is happening, and possible solutions to get rid
Problems with installing composer
I am currently trying to install composer in order to install laravel. Following their website instructions, I am entering the following code into my terminal: But without success, I get the following error: This gives me the notion that I do not have permission to do this, is this the reason and why is it occurring? Answer While I was
How can I parse command line arguments in PHP?
I call a PHP script from command line $ php my_script.php –num1=124 –first_name=don How can I get access to any key value pairs passed into this script? The keys can be arbitrary, so using getopt() with particular values will not work. Here is what I want access to in my script: If I use var_dump($argv), I get this output: Should
Symfony2 generate controller inside custom folder
Symfony2 has a command for generating controllers http://symfony.com/doc/current/bundles/SensioGeneratorBundle/commands/generate_controller.html Command’s default behavior is to generate the given controller inside controller folder within the bundle. Is it possible to customize the folder where the controller will be generated ( controller/backend for example ) ? Answer You can get all the available options of this command with the help command: No you can’t
How can I get PHP working again in the command line?
I’m completely at loss here and am about to wipe my hard drive clean and start from a fresh OS install. I’ve been trying for two days to create a new yii app in the terminal and have finally figured …
Pass a variable to a PHP script running from the command line
I have a PHP file that is needed to be run from the command line (via crontab). I need to pass type=daily to the file, but I don’t know how. I tried: but this error was returned: Could not open input file: myfile.php?type=daily What can I do? Answer The ?type=daily argument (ending up in the $_GET array) is only valid
Update Command-line Output, i.e. for Progress
I’d like to be able to show a progress meter in a simple PHP script on the command line. Instead of seeing Progress: 0% Progress: 1% etc… I’d like just the number to change, and replace the …