Page 1 of 1
Reading Properties Menu
Posted: Fri Jul 30, 2004 10:32 am
by fangorn
Alright, here's a strange one but I'll ask it anyway.
On Win32 programs, you can right click the exe, go to properties and there are several tabs. One tab is the version tab where versioning information is stored. I would like to read this version tab information from a PHP script for an exe that is on the server where PHP is located. This isn't reading from a client machine. Anybody know how to do that?
Posted: Fri Jul 30, 2004 11:12 am
by feyd
there are standard win32 calls to do this. However, since the win32 extension is buggered beyond all hope it seems, you may need to write your own extension to get at the information.
GetVersionInfo() can retrieve the information you are looking for.
Posted: Fri Jul 30, 2004 12:34 pm
by fangorn
Thanks for that heads up. Took your info and I wrote a console app that does the query that I need with the GetFileVersionInfo function. I'll look at how to make it into an extension. Would it be just as easy to use the shell_exec function to call this console app and use the output for the information I need? Is that a better route since this is a very specific feature I'm needing? Seems like an extension should be more generic. Thoughts?
Posted: Fri Jul 30, 2004 1:20 pm
by feyd
you could go that route, I was thinking the server may disallow shell_exec, as there are plenty of hosts that do this. Then again, you are looking at exe information on the server to begin with.. If the http server is running under a restricted user (it is, right?) then you may need some special code to get privledged access to read the file depending on where and what it is..
Posted: Fri Jul 30, 2004 1:31 pm
by fangorn
Well, I didn't realize that possibility. You're right, this server doesn't allow shell_exec at the moment. At least, the calling of my console app with shell_exec doesn't work. But I'm not getting an error or warning (I've commented out error_reporting call). Shouldn't I be seeing a PHP error?
If exec is disallowed, I can possibly get that changed, how does that get turned off? Or rather, how would I allow shells? I guess it's a security issue huh? I'll start looking into the extension path! Thanks.
Posted: Fri Jul 30, 2004 1:42 pm
by fangorn
Ok, I looked into this more. When you say disallow exec are you referring to PHP safe mode? I found that in the php manual. Safe mode is off on the server I'm trying this on. Must be a different problem.
Posted: Fri Jul 30, 2004 1:57 pm
by feyd
it may be inside the disabled functions list, which can only be changed in the php.ini file. It may also be in safe_mode, which can only be changed at the system level.
run the following to get the list of disabled functions:
Code: Select all
<?php var_export(ini_get('disable_functions')); ?>
Posted: Fri Jul 30, 2004 2:03 pm
by fangorn
that code returned '' - no functions are in the list. This is weird. This shell_exec works on my computer, but not on this server. Is it possible that the internet guest account has execution of exe's disabled? Is that even possible. I can obviously execute php scripts. Guess I'll look at the php extension idea. Thanks.
Posted: Fri Jul 30, 2004 2:04 pm
by feyd
is this running through cgi or native?
Posted: Fri Jul 30, 2004 2:12 pm
by fangorn
CGI under Windows 2000 with IIS 5.0