views:

105

answers:

3

My system has two PHP interpreters. One came bundled with the OS and the other I installed via the XAMPP package. All of my PHP extensions are applied to the XAMPP installation but PHPUnit seems to only run the version of PHP that came with my machine.

Does anybody know of a way I can configure or rebuild PHPUnit so that it uses my XAMPP PHP interpreter exclusively?

+4  A: 

Find the folder you installed PHPUnit in. There should be a file called phpunit.bat. It should have a line that reads something like

set PHPBIN="C:\php\php.exe"
%PHPBIN% "C:\php\phpunit" %*

Change it to read

set PHPBIN="C:\xampp\php\php.exe"
%PHPBIN% "C:\xampp\php\phpunit" %*

Or whatever the path to your PHP executable is

Gordon
+1  A: 

For Mac/Linux, the first line of the phpunit script with starts with

#!/usr/bin/php

change that to

#!/Applications/XAMPP/xamppfiles/bin/php

or whatever other php interpret you want to use.

Thomas
A: 

In agreement with Thomas' statement, additionally there's a line further below

if (strpos('/Applications/MAMP/bin/php5.3/bin/php', '@php_bin') === 0) {
    set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
}

That I've been told you're also supposed to change to reflect the PHP you're interested in using (I've set mine to MAMP obviously)

I've switched back and forth from 5.2 and 5.3 a lot recently :)

Alex C