April 3, 2013

PHP files repetitively and automatically being deleted from server folder

Karancan’s Questions:

I work with a group of about 6 to 7 other developers and we are facing a very strange problem. For quite a few weeks now, we’ve had a problem with four or five different PHP files getting deleted on what appears to be random intervals.

All but one of us is using Aptana Studio as our IDE. One person is using NetBeans. We have created PHP projects on Aptana and we sync over SFTP with a server running CentOS. The server in question is our development server. Half of us are running Windows and the other half are on Mac.

There seems to be little to suggest that it is one of our machines / IDE’s causing this issue. To test this, we have had days where we would leave out one person or a combination of people and see if the problem goes away but unfortunately we have been unable to find any pattern.

The one thing that is fairly consistent though is that the problem tends to occur between after noon and 5 pm. It started with a file called config.php being the only one affected. Then it spread to files called header.php and footer.php. At times it happens that one or more of these files get deleted almost every minute. All these files are in the same directory and nothing outside of this directory (called includes) has had this issue.

The permissions for all the directories and their descendants is set to 775 i.e. no write access to anyone who doesn’t have an SFTP account.

Does anyone know anything about Aptana or NetBeans- something to suggest that it is the IDE causing this issue? Or any thing else for that matter that could help us solve this mystery?


Edit 1: We do have GIT set up so we are covered but nevertheless this is a huge annoyance

Edit 2: There is nothing on the cron tab that would have any impact on these files

Edit 3: The pages are on an intranet and we are certain that there is no virus causing this

Edit 4: Everyone uses the same account for the SFTP connection

Edit 5: We got everyone to stop using an IDE and work on files using FileZilla. The problem persists.

Two things come to my mind about this

  • It might be a cron setup to delete files. Check your crons.
  • Or it can be a virus, that searches and deletes authentication related files from the site, like Config.php and etc

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!