in reply to Re^8: apache/perl caching problem
in thread apache/perl caching problem
The following is not a CGI script (it doesn't produce headers or any useful output) but it does show how you can log the name of the script, the directory it is located in, the process id it is running as and a version. You could incorporate something similar into your script.
#!/usr/bin/perl use strict; use warnings; use FindBin; my $VERSION = "1.0"; print STDERR "This is $0 version $VERSION located in $FindBin::Bin run +ning as process $$\n";
Output from a few executions is as follows:
ian@laptop2:~$ ./test.pl This is ./test.pl version 1.0 located in /home/ian running as process +6119 ian@laptop2:~$ ./test.pl This is ./test.pl version 1.0 located in /home/ian running as process +6120 ian@laptop2:~$ ./test.pl This is ./test.pl version 1.0 located in /home/ian running as process +6121
Note that the process id is different every time I run the script.
If you add similar logging to your CGI script, you should be able to find the output in your website error log. Then, if you change the version number every time you change the script, you will have a record of what version was running and what process number was running it. You could change only the version number, just to make a change, then restart your server and check the logs for entries with the old version number appearing after the restart. If you find one, use the ps command to find out what the process is. This will help to isolate the problem.
If you see a log entry on your server every time you submit a request from your browser, then it is reasonable to conclude the requests are making it to the server. There is still the possibility that the requests and/or responses are being modified between the server and browser. This is unusual, but it can happen. Don't worry about that yet. First, confirm that the server is running your script once for each request from the browser. Then confirm that each time your server runs your script it runs the "current" version. You might include the scripts version number in both the log and the response to the browser: you can put it in an HTML comment if you don't want it to be visible in the browser. Then you can check that the response received at the browser is from the current version of your script, or at least the same as the version that ran on the server.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: apache/perl caching problem
by ksublondie (Friar) on May 04, 2010 at 23:24 UTC | |
by ig (Vicar) on May 05, 2010 at 07:54 UTC | |
by Anonymous Monk on Sep 26, 2010 at 15:22 UTC |