My NetBeans have an option to add a path to a script that runs PHPUnit, however when I try to add this script to my NetBeans I get the error that it doesn't recognize the version. Says that version is ?.?.? and that is not supported. However my PHPUnit version is supported by NetBeans and work perfectly when I run it from the pear installer folder (PHP).
"Selected PHPUnit (version ?.?.?) is too old, upgrade it if possible (the minimum version is 3.3.0)" - I got 3.6.4.
My script looks like this
#!/bin/sh
phpunit --bootstrap MyBootstrap.php --stderr $*
And it works great on linux NetBeans. Just not on my Mac.
And yes it works perfect when I run it in the console.
Thanks a milion
/Marcus
I'm not sure what php runner is, but to recognize valid PhpUnit, NetBeans run command "phpunit --version", so check what this command gives you in console.
Once I had problem with this, so I simply found the code of phpunit that is responsible for "phpunit --version" and manually type what should be printed when this command is executed. So NetBeans "saw" correct version and everybody is happy :)
I solved the phpunit problem (too old phpunit message on netbeans)
First open terminal and then:
cd /private/etc
cp php.ini.default php.ini
open php.ini file
change include_path to include_path = ".:/usr/share/pear"
Problem solved :)
If however the problem is not solved then try install netbeans for php from netbeans.org
Mate, that is error by Netbeans (see bug id 188240), and it looks like it is not fixed yet. It happens on Mac OSX.
What i did is to rename Application/NetBeans/NetBeans 7.1.1 to Application/NetBeans/NetBeans7.1.1 (note the lack of space)
as per Xdebug, read this:
http://xdebug.org/find-binary.php
when you get the version for your server, add these lines into your php.ini:
zend_extension = /opt/local/lib/php/extensions/<name of your extension>/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
replacing <name of your extension> with, of course, the name of your extension :)
after this you should be ready to go.
Issue about version soved by reinstalling everything, however I now get this
PHPUnit 3.6.7 by Sebastian Bergmann.
The Xdebug extension is not loaded. No code coverage will be generated.
Cannot open file "/Applications/NetBeans/NetBeans".
How could I load Xdebug? Is that in php.ini or apache conf? or is that in NetBeans?
Related
I have mac, installed PHPstorm 10, now trying to install smarty, similar to as mentioned in following tutorial , http://phpwebscript.blogspot.com/2009/09/smarty-installation-steps-on-wamp-and.html,
i have installed mamp supporting PHP 5.6. everthing is configured file. as mentioned in the tutorial i have edited php.ini file under correct version. After everything is setup i get error on following;
require ('/Applications/MAMP/Smarty/libs/Smarty.class.php');
$smarty =new Smarty() //Undefined class smarty error;
When i run,
echo (defined('SMARTY_DIR') ? 'Yes' : 'No');
i get yes
any fix please.
I have solved this issue, following were the problems that i fixed,
Include path was not set, i though i have included path in php.ini now its ok, but when you create a project in phpstorm or netbeans, there is a folder created external libraries or include path, you have to include smarty, I did it and now everything ok
i had copied testinsall from net which was causing error, retyped it and now smarty is running perfect on phpstorm 10.
IntelliJ will not detect installed PHP even though it does exist and can be used from the command line. I have installed php via brew install php54. Below is a screenshot of my issue along with evidence that it does exist. I've tried clicking the refresh button many times, but it will not pick up the binary.
I just had the same problem. Through some hackery, I discovered it was due to some ansi escape sequences in my prompt. From your screenshot it looks like you might have the same or a similar issue.
Essentially, IntelliJ uses a php script to create an XML string out of some PHP configuration items, including $_SERVER. The $_SERVER superglobal contains environment variables and therefore picked up the escape character (0x1b) in the sequence. Since the escape character is invalid in XML, IntelliJ rejected the output and concluded the PHP interpreter was bad.
Once I removed the ansi sequences from my prompt, IntelliJ recognized the PHP interpreter right away.
Hope this helps.
I had the same issue, and it turned out my Homebrew install was severely out of date when I installed PHP. To fix it, I ran:
brew update && brew upgrade
With some quick help from jetbrains support, the latest EAP version fixed it for me: http://confluence.jetbrains.com/display/IDEADEV/IDEA+14+EAP
http://youtrack.jetbrains.com/issue/WI-23045
If you prefer to keep investigating the issue, see Chris' answer and search the idea.log for something like:
INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/php.xml file is null
idea.log locations
I've just now come back to this after some time and it looks like the latest version IntelliJ works with PHP installed via Homebrew. So I'm going to mark this as resolved.
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.
I am just getting start with Zend Framework and seem to run into this problem
Testing Note: PHPUnit was not found in your include_path, therefore no
testing actions will be created.
I am on mac 10.8.5, Using Zend Server 6 (free), and Zend Framework 1.12.3
Have pear and phpunit installed
which pear
/usr/local/zend/bin/pear
which phpunit
/usr/local/zend/bin/phpunit
from php info and include_path
Loaded Configuration File /usr/local/zend/etc/php.ini
include_path=".:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/bin/pear:/usr/local/zend/bin/phpunit:/usr/local/zend/share/pear:/usr/local/zend/share/pear/phpunit"
No matter what i put in the include_path, i always get the above notice, PHPUnit was not found in your include path.
I been searching and someone said zf.ini can cause this, and that file should be editted, however i can't seem to find such a file anywhere on my Mac. I do have previous Mamp and Xampp installations, but phpinfo() states the correct php.ini file loaded so i doubt that is the problem
Edit:
Okay so i finally managed to fix it. Using "zf.sh --setup" i found the paths to all the config files, including .zf.ini and how to edit it. The file did not exist, so i had to create it, and adding "include_path" to .zf.ini fixed the issue. However in the end i am overriding the php.ini which was probably being over ridden. I still like to know why adding pear path to php.ini didn't work, hopefully someone can explain that
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.