Hello Everyone,
I have a little problem with my PHP script. I have created a very detailed system using PHP and wish to upload it to a computer running XAMPP on my network. Because the file will be uploaded to a normal computer all of my PHP files will be accessible to anyone with the password to this computer. There are certain people that have access to this computer that would be nosy and want to look at/modify my code. Anyway, long story short, I would like a way to password protect the file when trying to acess it directly from the host computer, but still allow users on the network to use the file (ie. View the home page the PHP produces). I realize that this sounds really paranoid, but the server is not physically in my house so I have no way of knowing who accesses the computer (A few do on a regular basis). If you know of a way to do this, please post.
Thanks so much everyone!!!

Recommended Answers

All 4 Replies

Remove all windows user priviledges for the file except for the web server user, in IIS this would be IUSR_MACHINENAME, you could also look at obfuscating the file, there are a few open source php obfuscation programs about like POBS http://pobs.mywalhalla.net/

commented: Good Suggestion! This will be very helpful in protecting my file!! +1

Good idea!! Just one question. I was thinking that if there was a special account on the computer (XP) then that would mean that the account would have to auto load with XP so XAMPP was always running. Is there any way to automate this?

The best way would be to obfuscate the code prior to uploading it to the server PC, by doing this there is no alterations needed to the operating system/accounts. Also, look at http://www.raizlabs.com/software/phpobfuscator/ since this one would probably require little change to your source code to get this working. Providing the server is running PHP5 this would be the easiest option.

commented: Great Suggestion! This is the easiest way and probably abother I will use to protect my file!! +1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.