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 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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器