help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



Notes

Some trouble shooting tips.

General tips

When troubleshooting, always try and eliminate possibilities. Delete config files or temporarily rename them, and rebuild and recompile units. Narrow the problem down to the simplest program and the simplest setup.

Keep one compiler installed and delete all old .a/.o/.ppu/.dcu files.

Servers Other than Apache

Some web servers are not as reliable or standards compliant as Apache. Some servers contain creepy minor bugs that can cause headaches. An example is AnalogX's simple server software that they offer for free. When cgi programs using Powtils search for a pwu config file, the AnalogX server doesn't find the config file since the AnalogX has a bug: it doesn't utilize relative directories (at least this is our best guess).

Therefore we recommend using Apache or other known working servers recommended in PasForum by experienced Powtils users.

Lighttpd has been tested by many developers with Powtils and they have reported it is working great with Powtils.

See also this forum post.

Installing More Than One Server

Some people have multiple servers running or installed at once. This can cause conflicts or hard to diagnose issues. Localhost may not be the server you think it is. For example if you install Apache and install AnalogX at the same time, you may still have creepy bugs with your programs if AnalogX is still running and is overriding Apache.

Config File

Check that your config file contains comments with a pound sign at the start of each, or a name=value pair. Lines that can cause problems are ones without an equal sign and without a pound sign.

Bad syntax in the config file (lines without equal sign or pound sign) will cause:

Especially note line one of your config file, where your library path is located in 1.6.X versions. The library path, if you have it on line one, needs a pound sign in front of the path string, without any spaces.

We cannot trap all human mistakes made in config files, but in later versions we have made efforts to do more checks. For example in 1.6.1 if a line does not contain any name=value pair and contains text on a line without a pound comment sign, you will be given an error in your browser.

Compiling

If you ever have odd issues or problems compiling a program, try rebuilding the units using -B:
  fpc program.pas -B
In rare cases, even the -B option may not be enough. You may have to delete all .a .ppu .o files in your -Fu search path directories, and any drectories that you are compiling in. There is also a tool called delp available to help you delete the files quickly. Delp will not know magically which directories you wish to delete files in. You have to tell delp of the directory(ies) or local directory (.\ or ./) that you wish to delete files in.

Compiler Conflicts

Stick to using and installing one version of the compiler if possible. Using only one reduces possibility of two different system.pp units or two fpc.exe/fpc.cfg files conflicting.

The problem with having two compilers installed is the .ppu/.o/.a files may start conflicting. Example: if you have some units kicking round in directories which have been compiled with 2.0.4 and others with 2.2.0. This can creep up on you when some directory in your -Fu search path has old units that you don't know about since you haven't looked in or compiled in that directory for a while.

If you are an advanced or experienced user, you can avoid these problems by making all the units output to a single directory with the -FU option. Then when you need to delete all the .ppu files, just navigate to the -FU directory and delete all units (note that -FU is a different compiler option than -Fu)

{$DEFINE} or -d Compiler Option

If you use a command like:
  fpc program.pas -dSTATIC
And then you compile again without defines:
  fpc program.pas
Or if your unit contains:
  unit somefile;
   {$DEFINE STATIC}
  ...
FPC is not very smart when it comes to rebuilding units when DEFINES are changed on the fly. I have found I always need to rebuild units with -B if I change defines. (I guess this should be reported to FPC team as a compiler bug or a -d force build feature request)

So when flipping defines, always do commands like this:

  fpc program.pas -dSTATIC -B
  fpc program.pas -B
That forces the compiler to rebuilt the units with the new define enabled or disabled. Otherwise, old cached .o/.a/.ppu units with old defines or lack of defines may be used by the compiler.

Browser Cache

When testing your web programs with Mozilla, Internet Explorer, and other browsers.. remember to first configure your browser cache settings in a way that all confusion can be avoided. Delete the web browser cache and set web browser cache size to zero to avoid this being a possible cause of confusion.

Some browsers cache requests in weird ways and has caused me issues during development.. even CGI programs and not just static html pages.

Sanity Check

As a simple test, delete (or rename to .OLD) all traces of global or local pwu config files. If the program does not output a simple page with a simple:
   ERR XX see docs 
..when you delete all config files, then something is wrong with your system or server.

Without any config file, the program should always give you 'ERR XX see docs' since this error is output using simple system standard out calls. If these simple system calls won't work, nothing will. That's why this is a sanity check. Search your drive for all config files in your public html and cgi directories such as public_html/pwu/conf/.

Note: if you have disabled config files (available in 1.6.1 and later) then a simple hello world should always work as a sanity check. This is considering you have not used SetWebConfig in the hello world. I.e. a program like this:

uses pwumain;
begin
  webwrite('hello!');
  // and nothing more
end.

Gzip Compression Issues

Gzip output_buffering and output_compression settings should be turned off in the config file while troubleshooting. Older web browsers such as internet explorer on Win95 may not have gzip functionality.

Note: if you delete the config file then Gzip is not used to display the simple 'ERR XX: see docs' message. If you are using no config file define in 1.6.1, then buffering and compression is off by default.






lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505