php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #57910 Ensure SystemDrive and SystemRoot env vars are set
Submitted: 2007-11-13 22:00 UTC Modified: 2011-10-05 21:30 UTC
From: ezyang@php.net Assigned:
Status: No Feedback Package: svn (PECL)
PHP Version: 5_2 CVS-2007-11-13 OS: Windows Vista
Private report: No CVE-ID: None
 [2007-11-13 22:00 UTC] ezyang@php.net
Description:
------------
On Windows Vista, the Subversion extension fails spectacularly if the SystemDrive and SystemRoot environment variables are not set properly. When accessed via command line, these variables exist, but Apache, by default, strips them out. The Subversion extension should be responsible for re-constituting them.

Relevant links:

http://article.gmane.org/gmane.comp.version-control.subversion.subclipse.devel/2109


Reproduce code:
---------------
On Windows Vista, attempt to use SVN functions via Apache

Expected result:
----------------
Subversion functions work as normal

Actual result:
--------------
Subversion segfaults

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-14 01:44 UTC] alan at akbkhome dot com
can you not add them to the apache config 

http://httpd.apache.org/docs/1.3/mod/mod_env.html#setenv

Looks like a nasty kludge to stick in the extension..
 [2007-11-14 10:11 UTC] wez@php.net
I also believe that this should be configured in Apache; other 
apps and scripts also rely on those variables.
 [2007-11-14 13:37 UTC] ezyang@php.net
I'm changing this to a documentation problem. I think that this should:

1. Be fixed in Subversion so that the environment variables are not necessary (and also that libsvn doesn't segfault when this happens), or
2. Have the environment variables passed by Apache. PassEnv is more appropriate, but both work.

However, currently, when these environment variables are missing, the extension segfaults with no indication as to what went wrong (except that php_svn.dll is at fault). I would recommend:

1. Clearly documenting the requisite environment variables in the manual (something I can do)
2. Try to have the extension fail more gracefully in such cases, perhaps detecting when Windows Vista is running but the environment variables are not present

A user can even set the variables using putenv(), but they need to know they have to do so. It took me a while to figure out why calling php-cgi via command line worked, while Apache failed.
 [2008-06-30 20:56 UTC] scottmac@php.net
Can you see if the segfault still persists, pretty sure this is now corrected.

Regarding the error with the vars missing, I think this is down to Windows internals rather than subversion itself.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 09:01:29 2024 UTC