When I type:
php -info
I get this error message:
Could not open input file: o
I have php 5.4 installed. Trying to find info to configure IIS.
This was easy. Found the answer in an IIS forum.
http://forums.iis.net/t/1189386.aspx?Installing+PHP+on+IIS7
The -info flag has been depreciated. Its just -i now
Try php -i.
php -info will be interpreted as php -inf o so cause that error.
Related
I have a problem with this command : php bin/console server:run on Symfony 4
When I go to http://127.0.0.1:8000/ I have this error message :
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'J:\my_project\vendor\symfony\web-server-bundle/Resources/router.php' (include_path='.;C:\php\pear') in Unknown on line 0
Indeed, the router.php file does not exist !
But if I run this command : php -S 127.0.0.1:8000 -t public everything is ok.
Any idea ?
First check that you have installed the SF4 Web Server bundle :
> composer require server --dev
then you can start using it through Symfony using run / start command
Not sure if this is the case for you too, but it is probably worth checking (and may also be interesting for others having the same problem).
My antivirus software likes to put the router.php in quarantine (effectively removing it from that directory). Check if yours did the same and if so restore it and create an exception for that file. Additionally you should configure your antivirus to notify you if it puts something in quarantine, so you can intervene in time.
I'm developing in Ubuntu 14 and I get the following error when creating a databaes:
$ php app/console doctrine:database:create
This is the error output:
PHP Warning: require_once(/home/jesse/playground/www/symfony/htdocs/app/bootstrap.php.cache):
failed to open stream: No such file or directory in
/home/jesse/playground/www/symfony/htdocs/app/console on line 10
PHP Fatal error: require_once(): Failed opening required
'/home/jesse/playground/www/symfony/htdocs/app/bootstrap.php.cache'
(include_path='.:/usr/share/php:/usr/share/pear') in
/home/jesse/playground/www/symfony/htdocs/app/console on line 10
What Ive Tried
Running this in Vagrant
Running this Locally
This is one among several problem running Symfony2 under Ubuntu, the other forcing you to implement umask(0000) otherwise you have to get chmod +a permissions for log and cache folders, this seems like a bit of a hassle for something seemingly simple.
Does anyone know what to work around this error?
This should do the trick:
php /home/jesse/playground/www/symfony/htdocs/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php
I'm getting "Aborted due to warnings" error when running grunt in --verbose mode.
ar#Woody:~/www/mysite-frontend-dev$ grunt build:debug
...
Registering "grunt-karma" local Npm module tasks.
Reading /home/ar/www/mysite-frontend-dev/node_modules/grunt-karma/package.json...OK
Parsing /home/ar/www/mysite-frontend-dev/node_modules/grunt-karma/package.json...OK Use --force to continue.
Aborted due to warnings.
Is there a way to get more detailed output? This warning message doesn't say much...
In general you can pass a command-line flag like $ grunt build:debug --verbose or $ grunt build:debug --stack to see more details
There was an issue with grunt-concurrent and Debian "squeeze". Updating to the latest (0.4.1) grunt-concurrent resolved the problem.
I'm using Behat,mink in my Symfony2 project,so I follow those tutorials to make installation :
http://extensions.behat.org/symfony2/ , http://extensions.behat.org/symfony2/migrating_from_2.3_to_2.4.html
but when I run this command php behat.phar --init "#YouBundleName",I get this very strange error :
PHP Warning: require(Behat\MinkExtension\Extension): failed to open stream: No such file or directory in phar:///var/www/project/behat.phar/src/Behat/Behat /Extension/ExtensionManager.php on line 112
PHP Fatal error: require(): Failed opening required 'Behat\MinkExtension\Extension' (include_path='.:/usr/share/php:/usr/share/pear') in phar:///var/www/project/behat.phar/src/Behat/Behat/Extension/ExtensionManager.php on line 112
I'm sure I installed the last version of behat and mink mentionned in the second link above and then I made php composer.phar unpdate and cache clear too,but still the same error?
I had the same problem. Forgot you need to install behat/mink-extension as well as behat/mink. For example you might need to run:
php composer.phar require behat/mink-extension:*
Worked for me.
By the way, looks like you got confused by the two installation methods, phar vs composer. I'd go with the composer route because it's easier to update and manage versions. This would mean running php bin/behat ... instead of php behat.phar ....
I don't want to turn on xdebug code coverage for all scripts but I do want to be able to turn it on for a daily jenkins build which produces the code coverage.
I tried the following
phpunit -d xdebug.coverage_enable=1 -c phpunit-coverage.xml.dist
However I always get the following error
Configuration read from phpunit-coverage.xml.dist
Fatal error: Uncaught exception 'PHP_CodeCoverage_Exception' with message 'You need to set xdebug.coverage_enable=On in your php.ini.' in /usr/local/lib/php/PHP/CodeCoverage/Driver/Xdebug.php on line 72
PHP_CodeCoverage_Exception: You need to set xdebug.coverage_enable=On in your php.ini. in /usr/local/lib/php/PHP/CodeCoverage/Driver/Xdebug.php on line 72
Call Stack:
0.0002 627488 1. {main}() /usr/local/bin/phpunit:0
0.0050 1095880 2. PHPUnit_TextUI_Command::main() /usr/local/bin/phpunit:46
0.0050 1096608 3. PHPUnit_TextUI_Command->run() /usr/local/lib/php/PHPUnit/TextUI/Command.php:130
0.6419 39830848 4. PHPUnit_TextUI_TestRunner->doRun() /usr/local/lib/php/PHPUnit/TextUI/Command.php:192
0.9760 40345400 5. PHP_CodeCoverage->__construct() /usr/local/lib/php/PHPUnit/TextUI/TestRunner.php:258
0.9764 40358504 6. PHP_CodeCoverage_Driver_Xdebug->__construct() /usr/local/lib/php/PHP/CodeCoverage.php:119
Any ideas as to how I can get this to work, without having to change php.ini each time?
Yes, it can but only by running it like this:
php -dxdebug.mode=coverage bin/phpunit --coverage-clover='reports/coverage/coverage.xml' --coverage-html='reports/coverage'
Note: "..Xdebug: [Config] The setting 'xdebug.coverage_enable' has been renamed,.."
With php 7.4 and phpunit 9, it's possible set options with env
XDEBUG_MODE=coverage /usr/bin/phpunit
Using php 7.4 I has to use -d xdebug.mode=coverage
Because I use php -n my full line was -d zend_extension=xdebug.so -d xdebug.mode=coverage
In the end I discovered you cannot do what I originially wanted.
Instead the answer is to add second php.ini file which has xdebug and coverage enabled. Then
in my build.xml I used the following to run it.
php -c /usr/local/lib/php-coverage.ini /usr/bin/phpunit -c app/