run-tests fails to preserve SYSTEMROOT environment variableDescription:
------------
Due to changes introduced in RunTest.php v1.25 (Fri Feb 16 05:36:57 2007 UTC) phpt unit tests ran using "pear run-tests" have no SYSTEMROOT environment variable available.
For reasons I was unable to resolve mysql connections will fail without SYSTEMROOT - with the error message "Can't create TCP/IP socket (10106)"
The system_with_timeout() function introduced RunTest.php v1.25 uses proc_open() and expressly sets the environment based on the contents of $_ENV. The problem is that if the php.ini variables_order option does not contain "E" $_ENV will be empty.
Attached is a patch to RunTest.php v1.52.
Test script:
---------------
--TEST--
check for "Can't create TCP/IP socket (10106)" error
--FILE--
<?php
$success = mysql_connect('localhost', 'root', '');
?>
--EXPECT--
Actual result:
--------------
Warning: mysql_connect(): Can't create TCP/IP socket (10106) in /tmp/test.php on line 2lukasfeiler
lukasfeilerhttp://pear.php.net/bugs/11936
PEAR Bug
Reported by lukasfeiler
2007-08-29T23:24:58+00:00
PHP: 5.2.3 OS: Windows XP Package Version: CVS
Description:
------------
Due to changes introduced in RunTest.php v1.25 (Fri Feb 16 05:36:57 2007 UTC) phpt unit tests ran using "pear run-tests" have no SYSTEMROOT environment variable available.
For reasons I was unable to resolve mysql connections will fail without SYSTEMROOT - with the error message "Can't create TCP/IP socket (10106)"
The system_with_timeout() function introduced RunTest.php v1.25 uses proc_open() and expressly sets the environment based on the contents of $_ENV. The problem is that if the php.ini variables_order option does not contain "E" $_ENV will be empty.
Attached is a patch to RunTest.php v1.52.
Test script:
---------------
--TEST--
check for "Can't create TCP/IP socket (10106)" error
--FILE--
<?php
$success = mysql_connect('localhost', 'root', '');
?>
--EXPECT--
Actual result:
--------------
Warning: mysql_connect(): Can't create TCP/IP socket (10106) in /tmp/test.php on line 2]]>PEAR Bug
Reported by lukasfeiler
2007-08-29T23:24:58+00:00
PHP: 5.2.3 OS: Windows XP Package Version: CVS
Description:
------------
Due to changes introduced in RunTest.php v1.25 (Fri Feb 16 05:36:57 2007 UTC) phpt unit tests ran using "pear run-tests" have no SYSTEMROOT environment variable available.
For reasons I was unable to resolve mysql connections will fail without SYSTEMROOT - with the error message "Can't create TCP/IP socket (10106)"
The system_with_timeout() function introduced RunTest.php v1.25 uses proc_open() and expressly sets the environment based on the contents of $_ENV. The problem is that if the php.ini variables_order option does not contain "E" $_ENV will be empty.
Attached is a patch to RunTest.php v1.52.
Test script:
---------------
--TEST--
check for "Can't create TCP/IP socket (10106)" error
--FILE--
<?php
$success = mysql_connect('localhost', 'root', '');
?>
--EXPECT--
Actual result:
--------------
Warning: mysql_connect(): Can't create TCP/IP socket (10106) in /tmp/test.php on line 2]]>2007-08-29T23:24:58+00:00
cellog [2007-09-02 21:59] http://pear.php.net/bugs/11936#1188770396
This bug has been fixed in CVS.
If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
The only way around this is to manually enable EGPCS when running the PEAR command. Fortunately, this is easy to do, we just add -d variables_order=EGPCS to pear.sh and voila - there's your environment.]]>This bug has been fixed in CVS.
If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
The only way around this is to manually enable EGPCS when running the PEAR command. Fortunately, this is easy to do, we just add -d variables_order=EGPCS to pear.sh and voila - there's your environment.]]>2007-09-02T21:59:56+00:00
lukasfeiler [2007-08-30 00:30] http://pear.php.net/bugs/11936#1188433807
I just realized that the problem of course goes beyond SYSTEMROOT. Whatever environment variables one might want to use to influence a unit test will not be passed!
I'm currently using an environment variable to set the DSN used for database dependent unit tests.]]>I just realized that the problem of course goes beyond SYSTEMROOT. Whatever environment variables one might want to use to influence a unit test will not be passed!
I'm currently using an environment variable to set the DSN used for database dependent unit tests.]]>2007-08-30T00:30:07+00:00