Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 9th January 2012, 17:09
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 392
Thanks: 29
Thanked 58 Times in 50 Posts
Default Apache misreading PHP files after file and directory modifications

I have a shell script that I use to "build" a PHP application on a development server.

Some percentage of the time, this build process causes Apache to interpret PHP files incorrectly.

In particular, I see error message that make absolutely no sense, such as "Class XYZ cannot be redeclared in file.php", even though the class in question is declared only once.

Another common error message is that a given file that is require()d is missing, even though the file is, in fact, present on the filesystem.

The only way I've been able to fix these problems when they occur is to restart Apache. As soon as I restart Apache, all of the errors disappear and the website/application functions as expected.

Because restarting Apache fixes the problem(s), Apache seems to be at fault.

Does anyone know if Apache "caches" files in some manner when running under ModPHP? I can't think of any other reason for this behavior.

It seems absurd that Apache would malfunction when files are added/deleted/moved on the filesystem, as any shared hosting environment would be plagued by such an issue.

The build script that I'm using performs the following actions:

1.) Delete all contents in website's document root.

2.) Export SVN repository contents to website's document root.

3.) Copy configuration files (not stored in SVN repo) into place.

4.) Copy .htaccess.txt to website document root and rename to .htaccess.

5.) Reset permissions on website document root (a series of chown and chmod commands).

The website in question is running under ModPHP.

I thought about changing the PHP mode for this website to Fast-CGI and seeing if the problem still occurs, but this will take considerable effort on my part, so I figured that I'd ask here first.

Thank you for any insights.
Reply With Quote
Sponsored Links
 

Bookmarks

Tags
apache, error, modphp, sporadic

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ubuntu and nginx delgado2061 Installation/Configuration 0 27th November 2011 23:36
rkhunter warnings esezako General 7 27th September 2011 07:28
Can't receive mails baicunko Server Operation 12 3rd August 2011 22:02
Hacked server Captain Installation/Configuration 8 23rd December 2010 10:39
Unable to install ISPConfig bdonecker Installation/Configuration 21 26th May 2009 08:20


All times are GMT +2. The time now is 22:47.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.