Netbeand 7.1 and PHPUnit 3.6.10 - netbeans

I have been trying to run simple PHPUnit tests with Netbeans 7.1 and PHPUnit 3.6.10 on Xampp 1.7.7
I have downloaded PHPUnit using PEAR and when I type the following, I get the output below
C:\xampp\php\PEAR>phpunit --version
PHPUnit 3.6.10 by Sebastian Bergmann.
Netbeans 7.1 is my problem. I have configured the following
Tools -> Options ->PHP (PHP 5 Interpreter) is C:\xampp\php\php.exe
Tools -> Options ->PHP (Unit Testing) C:\xampp\php\phpunit.bat
I keep getting the dreaded
Selected PHPUnit (version ?.?.?) is too old, upgrade it if possible (the minimum version in 3.3.0)
displayed.
Has ANYONE solved this issue?
PS the irony is, it was working at one stage!
Stephan

Yes...
I'm a WAMP guy, so I don't know XAMPP paths, but this is what you need to do:
Your PEAR path is wrongly set to C:\php5\pear. This is the development setting. Wamp/Xampp should have changed it, but they didn't.
The Solution:
Edit every php.ini file, change INCLUDE_PATH to your path where WAMP Server is installed(e.g. C:\WAMP\bin\php\php5\includes).
Now run go-pear.bat, and follow all the instructions. If everything is fine then its OK. You can check it by running http://localhost/phpinfo(). Else if go to Step 3.
Right Click My Computer->Advanced Tab->Environment Variables->Add New User Variable->PHP_PEAR_INCLUDE_PATH->Add new value->The path where PEAR is installed(e.g. C:\WAMP\bin\php\php5\PEAR).

I have just fixed by adding c:\xampp\php into the PATH environment.
Guessing Netbeans, check phpUnit via the cmd:
C:\>phpunit --version
PHPUnit 3.6.11 by Sebastian Bergmann.

Related

PHPUnit Skeleton Generator fails to create file

I have installed, via Composer, the latest versions of PHPUnit and the Skeleton Generator, 4.1.3 and 2.0.1, respectively. I have installed it to my project directory and confirmed that I can test all files. I cannot, however, run the skeleton generator to create new tests. I am using Netbeans and its PHPUnit integration to create the tests. When I attempt to generate the tests, I get the following:
"C:\xampp\php\php.exe" "C:\Users\Bob\Projects\[myProject]\website\vendor\phpunit\phpunit-skeleton-generator\phpunit-skelgen" "--test" "--" "Security\SecureAPI" "C:\Users\Bob\Projects\[myProject]\website\src\Security\SecureAPI.php" "Security\SecureAPITest" "C:\Users\Bob\Projects\[myProject]\website\test\phpunit\src\Security\SecureAPITest.php"
phpunit-skelgen 2.0.1 by Sebastian Bergmann.
[InvalidArgumentException]
Command "Security\SecureAPI" is not defined.
Done.
I had the Netbeans 'Use Bootstrap for Creating New Unit Tests' option selected prior to this, and got this error:
"C:\xampp\php\php.exe" "C:\Users\Bob\Projects\[myProject]\website\vendor\phpunit\phpunit-skeleton-generator\phpunit-skelgen" "--bootstrap" "C:\Users\Bob\Projects\[myProject]\website\test\phpunit\bootstrap.php" "--test" ...
[InvalidArgumentException]
There are no commands defined in the "C" namespace.
Generating tests with version 1.2.1 worked fine on my old development machine. I'm wondering if the issues are specific to version 2.0.1 of the skelgen. It seems to be viewing the C: as a namespace, whereas 1.2.1 did not. I've confirmed that Netbeans produced identical command line instructions for 1.2.1 and 2.0.1, so it appears that the way they are being interpreted has changed.
Has anyone else seen this? Any ideas? I'm running a Win7 machine with Netbeans 8.0. Thanks in advance.
Try to download Dev build of NetBeans from here, the issue with changes in Skeleton Generator 2.x was fixed few days ago

Zendframework and Xampp Installation Problems

I am trying to install Zendframework Version 1.11.11 to my PC using Xampp version 3.1.0 3.10 . When I run the "ZF" command in "cmd" I receive the message "ZF is not a recognized operation.....".
What I tried so far:
Going to my computer properties and changing the path. ;\C:\xampp\php; and \C:\Zend\bin
What else can I do to solve this problem?
The path to zf (to the zf.bat file, to be exact) needs to be in your system path, not in php.ini includes. Refer to this question on Superuser. If your OS is not Win 7, you might need to google for the corretc instructions on setting the path.
Alternatively, you can also use the zf command with the full path:
C:\xampp\Zend\bin\zf create project myproj

Can't get MAMP to load xdebug (phpinfo())

MAC OSX 10.7.5 -- MAMP 2.1.3 -- XDEBUG 2.2.3
I used the xdebug wizzard to download and install using the terminal. After following the steps
Rebooted MAMP but no xdebug in phpinfo();
I thought it was weird that the wizzard says all you have to do it paste zend_extension = /Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so in the end of your php.ini file
I did add quotes around the pathname - the pathname from the wizzard came without them
Every other tutorial says there is more than just this one line that needs to be added
MAMP seems to have its own 'zend_extension = "/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"' that just needs to becommented out. Anyway I tried both the pasting from the wizzard as well as uncommenting.
Since I'm trying to use xdebug with my PHPstorm trial, I checked for the steps layed you at http://www.dotvoid.com/2012/09/using-xdebug-in-mamp/
Again it's weird: Here it says that all you need to do it add these 2 lines
xdebug.remote_host=127.0.0.1
xdebug.remote_enable = 1
It's weird because other tutorials make you add more lines (back when I tried to get xdebug on an older version of MAMP to go with netbeans without success) about the localhost.
Here's what's in my php.ini file now:
[xdebug]
zend_extension= "/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1
I also checked if I'm configuring the right php.ini file, looking in phpinfo(); where it says which php.ini file is loaded. In this case /Applications/MAMP/bin/php/php5.4.10/conf/php.ini I verified if this is the correct php.ini file that I'm edititing and it is.
The last anwser in this SO question here speaks of two certain files that need to be the same binary maybe one file is 32bit binary and the other one is 64bit. When I tried to check this, the files mentioned in that question (/path/to/mamp/Library/modules/php5.3/libphp5.so) are not in my current installation of MAMP. In my current installation, I can go to Applications/MAMP/Library/modules, but there is no folder in that modules folder, leave alone one that says php of any sort.
In this tutorial, there is a mention of updating PEARL. This may not be relevant to my issue but I just followed it because I don't know really, I thought it wouldn't hurt. When I try to do that in my terminal the error message says
Xdebug requires Zend Engine API version 220090626.
The Zend Engine API version 220100525 which is installed, is newer.
Contact Derick Rethans at http://xdebug.org/docs/faq#api for a later version of Xdebug.
I found this issue in the xdebug FAQ. I quote
it is most likely because you compiled Xdebug against PHP headers that belong to a different PHP version that you're running
Further explanation confirms that the message about the zend api version points to the same issue and that two versions of PHP are colliding somehow.
The solution to this is explained on the same FAQ page where it says
Q: How do I find which phpize to use? [...]If it doesn't match up, and perhaps the wrong "phpize" binary is found on the path, you can
run configure as follows:
1. /full/path/to/php/bin/phpize
2. ./configure --with-php-config=/full/path/to/php/bin/php-config
I don't know how to interpret this in practice. But here's what I have tried
I was still in the /usr/bin and tried the first command usr/bin/phize. this returned Cannot find config.m4. Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
I don't know what they mean by the top level source directory of the module. Maybe 1. and 2. are 1 command? And the module means xdebug.so?
No matter what I try though, I keep getting the Cannot find config.m4 error whenever I just even try to run phpize. I tried running phpize from /usr/bin/phpize or from /Applications/MAMP/bin/php/php5.4.10/bin/phpize. Same error came

Using XDebug with Eclipse PDT & XAMPP

I cannot debug a PHP script as a script. It always terminates immediately after starting. I set up an Xdebug log in my php.ini, but it's completely unhelpful. Xdebug does show up on my phpinfo(), so I know it's loaded in Apache.
I can also debug code as a webpage (which provides no info on variables and will not stop on breakpoints though), so I know Eclipse has the proper server settings. Both debug options use the same PHP exe (the one installed with XAMPP, php 5.3.1 compiled with vc6 compiler). I made sure that the compilation of Xdebug matched these settings.
On a perhaps related note: I noticed that I could only load Xdebug with the zend_extension command, instead of zend_extension_ts even though my version of PHP is indeed thread safe? I have to admit I'm a little confused by that.
I also made very sure that wherever I could select "XDebug" in Eclipse, I did. I've followed two tutorials to no avail here. Anyone have any ideas? I've tried the version of Xdebug bundled with my XAMPP (2.0.6-dev) and I also downloaded a new .dll, version 2.1.
Thanks!
Excellent instructions for Setup XDebug on XAMPP and Eclipse
#user629300 Instructions are good for eclipse versions prior to 3.5 see the links to get instructions for version based instructions. Also Getting XDebug to work with apache xampp to debug php, has pictures with good explanations. They are a little stale though.
A summary of the details from the first link, assuming PHP > 5.3 (which hopefully everyone is running now!):
Make sure that your php.ini file contains the following:
[XDebug]
zend_extension={xampp-folder}\php\ext\php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
Remove any config entries under the [Zend] heading, particularly those starting with zend_extension
Configure Eclipse:
in Window -> Preferences -> PHP -> Servers, configure the PHP server to use XDebug, add the base URL and local web root
in -> Installed debuggers, configure XDebug to accept remote sessions
(optional?) configure the PHP executable to point to php.exe in your XAMPP installation
You should now be able to hit breakpoints in Eclipse by adding XDEBUG_SESSION_START to the query string of your URL, e.g. http://localhost/?XDEBUG_SESSION_START.
first download the dll for xDebug
then edit your php.ini file
zend_extension_ts = “C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll”
make sure the line is uncommented
restart apache
make sure you are editing the right php.ini file

symfony plugin installation fails on windows because it is "unable to unpack" the tgz

I tried to install the sfTaskExtraPlugin using
symfony plugin:install sfTaskExtraPlugin
and received
Installation of "sfTaskExtraPlugin" plugin failed: unable to unpack (...)sfTaskExtraPlugin-1.3.3.tgz
I know I can simply install it manually by unpacking it to the plugin directory and including it into the ProjectConfiguration.
But I would like to be able to install all that is possible through the installer, as it is way more comfortable.
My system details: symfony 1.4 on Windows 7 (64 bit) with XAMPP 1.7.4.
Thanks!
Not an expert on this but my guess is that you're missing a utility/program that would allow Windows to unpack the tgz file. I'd Google around, install the relevant utility(ies) and try again.
I'm using the exact same setup as you as my dev environment and don't have that problem.
I have same problem and I have no solution.
One solution is: try again and again and again. It should work! :)
I'm not kidding. To install symfony 1.4.8 via pear on my Windows7 by using xampp 1.7.4 I just stupidly repeated installation.