php in windows

Posted on 2011-03-13
Last Modified: 2012-05-11
I have a php code run on windows I have only one machine i dont want my staff to know password  how can i conceal config.php which keep my sql user name and password from mystaff
Question by:teera
  • 3
  • 2
  • 2
  • +4
LVL 12

Expert Comment

by:Mohamed Abowarda
ID: 35124917
You will have to store the username and password in more secure place, I recommend you to store them in database and use MD5 hash.

Author Comment

ID: 35125094
Hi Medo3337
 If i encript it only that file it work or not and how can i encrypt it
LVL 12

Accepted Solution

Mohamed Abowarda earned 100 total points
ID: 35125134
To encrypt the password with MD5 hash use php md5() function

$password = "This variable will store the original password";
$password = md5($password);

Now $password contains the encrypted password.

I don't recommend you to save your login information into PHP file.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

LVL 13

Expert Comment

ID: 35125165
I think what teera needs is prevent others from viewing his "MySQL Account" (which is written in config.php to connect to DB)
If I'm right, then teera needs some kind of sourcecode encoding, so that other can't view it.

Some recommendation: Ioncube, Zend Guard (all non-free unfortunately)

Author Comment

ID: 35125448
Hi experts

Are there any software is free I need only encript 2 or 3 file
LVL 27

Assisted Solution

by:Lukasz Chmielewski
Lukasz Chmielewski earned 100 total points
ID: 35125772
It is not that simple. Is your skilled with computers / programming ?
Either you encrypt the file as dsmile says or you could buy another machine (or for that matter put a virtual one) and install a web server there with proper permissions. The machine you have now would have just an access to view the page / application.

Expert Comment

ID: 35126658
Encrypt and store in config file... the simple one
LVL 34

Assisted Solution

by:Beverley Portlock
Beverley Portlock earned 200 total points
ID: 35127998
IF they have access to the PC in question then, ultimately, there is nothing you can do.

In securing systems the first rule is to restrict physical access to the machine because anyone in the room with it can do what they like. Even if you password protected the machine they could reboot it using a "Live CD" or an OS on a memory key and then read whatever files they wished. Chnaging the OS to Mac or Linux would make no difference either. If you stripped the machine down and removed all CDs, floppies, USB connectors, etc then you still would not be secure because it only takes a few seconds to pop the lid and remove the hard drive.

I know this seems extreme, but it makes the point - as long as other have physical access to the machine then data stored on it cannot be secure. Your only hope would be to add encryption software and encrypt the entire hard disk and then never give the encryption key out for any reason and never let anyone else use the PC either.

Personally, I would rent a low cost VM on an external server and put everything on it instead and logon with SSH.
LVL 14

Assisted Solution

by:Scott Madeira
Scott Madeira earned 100 total points
ID: 35128462
If your concern is with the other people knowing your MySQL username and password for the database then I suggest you create an additional user in the database with what ever rights they need for the data and give that username and password to your employees.  this is what would be in the config.php file.

You would have the root/admin username and password available to you if you ever needed to access the database outside of your application.

When your employees no longer need access to the database you can delete the new username/password.
LVL 12

Expert Comment

by:Mohamed Abowarda
ID: 35128678
Put config.php in a folder and set the access permissions for that folder, so your staff wouldn't be able to access it.
LVL 34

Assisted Solution

by:Beverley Portlock
Beverley Portlock earned 200 total points
ID: 35129105
For all of you who think that changing a password on a machine that is not physically secured, here is how to reset ANY MySQL password including the root password

"If you set a root password previously, but have forgotten it, you can set a new password. The following sections provide instructions for Windows and Unix systems, as well as generic instructions that apply to any system. "

Notice that this is listed in the MySQL on line manuals - I'm not leaking secrets here.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Wordpress Pagination Function Not working ? 7 39
How to fix Datetime in MySQL? 4 50
XML extra information 8 29
mysql query for sum() 3 28
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question