cancel
Showing results for 
Search instead for 
Did you mean: 

strangely named PHP file in \public

stuck
Grafter
Posts: 87
Thanks: 2
Registered: ‎21-05-2009

strangely named PHP file in \public

In my new CGI space, in the \public folder there is a file with a name made up of a string of random characters.  The name begins and ends as follows:
Y3V..............................=.php
The content of the file starts:
<?php $envVar = array("GATEWAY_INTERFACE","HTTP_ACCEPT","HTTP_ACCEPT_ENCODING","HTTP_ACCEPT_LANGUAGE",...
The date on the file is 22/02/2014, which was the day I first started looking at the new CGI however the time on the file is several hours before I did anything on the platform, which was to upload and begin to set up zenphoto.
What is the purpose of this file, is it something crucial or can it be deleted.
Lest asking such questions reveals my ignorance and indicates I shouldn't be anywhere near a CGI server then I freely confess I am a total novice but I do seem to have got zenphoto working and I am beginning to build a photo gallery so I'm not unteachable.
Thanks,
stuck
8 REPLIES 8
7up
Community Veteran
Posts: 15,362
Thanks: 1,176
Fixes: 14
Registered: ‎01-08-2007

Re: strangely named PHP file in \public

I seem to recall that phpinfo() won't be available on the new ccgi platform so I would suspect looking at that array of environment variable names that it is supposed to look through the $_SERVER array or something and print ouf the values for new users to see.
As for the file name.. maybe some automated system has gone a bit wonky?
I need a new signature... i'm bored of the old one!
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: strangely named PHP file in \public

That file is mentioned as the script environment on the Control Panel Disk Usage application Setup/Environment tab. If you browse to it you'll find it lists the PHP $_SERVER[…] array values for the keys listed in the $envVar array.
What use users would make of it is a moot point. There are a lot more $_SERVER key/value pairs that users writing code might use.
David
David
avatastic
Community Veteran
Posts: 1,136
Thanks: 2
Registered: ‎30-07-2007

Re: strangely named PHP file in \public

Surely anyone wanting to interrogate $_SERVER variables is capable of writing this script

<!doctype html>
<html>
<head/>
<body>
<ul>
<?php
foreach ($_SERVER as $k => $v) {
echo "<li>${k} => ${v}</li>";
}
?>
</ul>
</body>
</html>

Having unexpected files is nothing but troubling as people may think they've had their site hacked.
Just my 2p's worth.
A.
F9 member since 4 Sep 1999
F9 ADSL customer since 27 Aug 2004
DLM manages your line the same way DRM manages your rights.
Look at all the pretty graphs! (now with uptime logging!)
stuck
Grafter
Posts: 87
Thanks: 2
Registered: ‎21-05-2009

Re: strangely named PHP file in \public

Quote from: spraxyt
That file is mentioned as the script environment on the Control Panel Disk Usage application Setup/Environment tab. If you browse to it you'll find it lists the PHP $_SERVER[…] array values for the keys listed in the $envVar array.

You mean I'm supposed to see a list of values in the Script Environment box?  All I see is:
/services/webpages/c/c/ccgi.<myusername>.plus.com/public/Y3V..........=.php
stuck

Scratch the above, I've worked out what I should have done and when I go to my CGI space and then add the strange file name to the URL I get a page that displays:
values for:
GATEWAY_INTERFACE
HTTP_ACCEPT
HTTP_ACCEPT_ENCODING
HTTP_ACCEPT_LANGUAGE
HTTP_CONNECTION
HTTP_HOST
HTTP_USER_AGENT
PATH
REMOTE_ADDR
SERVER_ADDR
SERVER_ADMIN
SERVER_NAME
SERVER_PORT
SERVER_PROTOCOL
SERVER_SOFTWARE
Does this file have to have such a bizarre name?  Would it break something if I renamed it to something a bit more obvious, like 'serverArrayyValues.php'
stuck
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: strangely named PHP file in \public

I assume the awkward name is specific to your instance and makes it unlikely to be discovered and executed by someone else. I can't imagine anything within the system relying on that file being present so it could be renamed to the more memorable name you mentioned if you wished.
However you might find copying the PHP script posted by avatastic, storing it with your suggested name, and browsing to it gives a more comprehensive and useful list.
David
David
stuck
Grafter
Posts: 87
Thanks: 2
Registered: ‎21-05-2009

Re: strangely named PHP file in \public

Quote from: spraxyt
...it could be renamed to the more memorable name you mentioned if you wished.
...you might find copying the PHP script posted by avatastic ... gives a more comprehensive and useful list

Thanks, I will experiment.
I guess though if I do rename this file then it will no longer be listed in the Control Panel Disk Usage application Setup/Environment tab..?  I suppose I'll find the answer to that in the course of experimenting.
stuck
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: strangely named PHP file in \public

Based on the experiences reported in the other current thread Hostopia will regard having one of these oddly named files as a bonus we shouldn't be without. So if you rename it another one is likely to reappear. Sad
David
David
stuck
Grafter
Posts: 87
Thanks: 2
Registered: ‎21-05-2009

Re: strangely named PHP file in \public

Quote from: spraxyt
Based on the experiences reported in the other current thread...

I can report that as a consequence my site reverting to it's (useless) fresh out of the migration box state this oddly named file was NOT present.  However as soon as I used the Control Panel Disk Usage application Setup/Environment tab it appeared in /public.
Further, having renamed the file and then re-run the Control Panel Disk Usage application a new copy of the file.
Fantastic, just the sort of Crazy feature I needed.
stuck