You are here: Re: Windows registry access in PHP webpage possible? « PHP Programming Language « IT news, forums, messages
Re: Windows registry access in PHP webpage possible?

Posted by Boris on 11/18/84 11:38

"Alvaro G. Vicario" <webmaster@NOSPAMdemogracia.com>,
news:1016g7k091kjt.1ryugnjrk4kqo.dlg@40tude.net...
> *** Boris escribiσ/wrote (Fri, 27 Jan 2006 18:32:36 +0100):
>> Has anyone ever managed to read a Windows registry key in a PHP webpage?
>> I
>> installed the PHP extension win32std and saved their sample script from
>> http://wildphp.free.fr/wiki/doku.php?id=win32std:index#registry_access as
>> a
>> webpage. However when I open the webpage (PHP 5.1.2, Windows Server 2003,
>> IIS 6) I get the error message "Warning: Can't open registry key: The
>> operation completed successfully." Is registry access only possible in
>> Windows executables?
>
> Just speculating... Apache normally runs under the local system account,
> if
> I recall correctly. The chosen registry key may have more restrictive
> permissions.

The script tries to read "HKEY_CURRENT_USER\Control Panel". As far as I know
this key exists for all user accounts. And each user should be able to read
his HKEY_CURRENT_USER branch, too.

> I suggest you first try to run your script from the command line, so it
> has
> the same privileges as your personal user. If that's the issue, it can be
> fixed later.

Thanks, I tried that. It works! Actually I would agree that it is a
permission issue but see above. According to
http://support.microsoft.com/kb/163846/en-us the registry keys of the SYSTEM
account are stored at \HKEY_USERS\S-1-5-18. When I check
"\HKEY_USERS\S-1-5-18\Control Panel" the SYSTEM account does have
read-access. I would expect the PHP webpage to be able to find and read this
key under \HKEY_CURRENT_USER?

Boris

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация