douju3911
douju3911
2012-09-19 05:42
浏览 58
已采纳

上传的PHP脚本没有刷新

I'm sure it's something obvious, but I'm pretty stuck here. I have a LAMP server (Centos 5.3, PHP 5.3.8) which has been working no problem. I modified and re-uploaded (via SFTP) a particular PHP script to the server, but when I reloaded the page the old script still runs. I can see that the new file is there and that the timestamp and size match the new version, but it always outputs as if the file was unchanged. I even tried replacing it with a simple

<?php die('test'); ?> 

test file, same result. It's not a browser cache problem (reloading, different browsers, etc all show the old script, and I can pass $_GET variables in and it runs as the old script). If I rename the file it renders correctly (with the new changes) under the new name and the system correctly throws a 404 error at the original location. When I return it to the original filename it reverts to rendering as the old version. I figured it was an e-accelerator issue (running 0.9.6.1) so I cleared the cache (emptied /var/cache/php-eaccelerator) and restarted the server but no dice.

Is there anything else that might be causing the server to cache the old script?

EDIT - SOLUTION!

OK, unsurprisingly, this ended up being an application-specific problem that I should have figured out sooner. The application was set up with a "custom-override" system that was causing the issue... basically to make updating easy but also allow for customization by clients, the system was set up with a special /custom/ folder which clones the folder structure of the base application. Before serving, Apache apparently checks for an identically located file in the custom structure and serves it instead if it exists. Basically there was a custom script uploaded to the relevant directory which was overriding any file I uploaded into the main application directory. Apparently there was an overriding script loaded into the custom directory.

@Dagon, thanks for the suggestion to disable eAccelerator. I was so convinced that it was the source of my problem that I didn't bother to check .htaccess. Once I ruled that out I started thinking more clearly.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duanchensou8685
    duanchensou8685 2012-09-19 06:37
    已采纳

    This ended up being a localized issue. As I mentioned in the edits to the question, the application was set up with a "custom-override" system that was causing the issue... basically to make updating easy but also allow for customization by clients, the system was set up with a special /custom/ folder which clones the folder structure of the base application. Before serving, Apache apparently checks for an identically located file in the custom structure and serves it instead if it exists. Basically there was a custom script uploaded to the relevant directory which was overriding any file I uploaded into the main application directory. Apparently there was an overriding script loaded into the custom directory.

    点赞 评论