An early introduction video showing the first day the tool was tested is available here.
Not only MS Windows users, but Mac/Apple and Linux/BSD desktop users will also be able to use these tools too. We just happened to release the MS Windows copy of fpw.exe first.
Note: if you downloaded 0.0.1, please download 0.0.2 as there are readme updates included.
Out of over 1100 people who saw the video from the delphi community.. only a few people showed serious interest - and I now understand why kylix failed. There is not so much interest in Unix programming in delphi ;-)
EditPlus and other editors can currently use fpw/fpwserv with clickable line info, but delphi not yet. The tutorial shows how to setup FPC but you can use the tutorial to setup FPW too.. as FPW acts just like FPC.
First place the fpw.exe program and fpw.cfg file in a directory that is located in your fpc.exe directory, such as:
c:\fpc\2.2.0\bin\i386-win\Then try executing the command in an ms-dos window:
fpw.exe(You can start a command line using RUN->cmd or RUN->command from start menu)
More instructions are included in the readme in the above zip file.
You can hook up the fpw.exe program to an IDE like Delphi or a text editor like EditPlus, Slickedit, Lazarus, Textpad, ConTEXT, PSPad, etc. FPW.EXE acts just like a freepascal compiler, but it has some other command line parameters as explained when you run fpw.exe in your console window the first time.
The tool will be improved so that it is easier to use with Delphi's tools menu (delphi doesn't like slashes near tools macros).
If you have problems such as 500 error you should check the permissions of your executables and directories on the unix server. You can change permissions using FTP. Some web hosting companies are picky about proper permissions.
On many servers, permissions must be set to 755 for fpwserv, ppc386, and fpc binaries.
On some servers, the permissions required are 777, 757, or 767. Check with your web host company to be sure.
Check also directory permissions for cgi-bin and subdirectories.
If you are not connecting to a web host company and you are connecting to an emulator or a server of your own, then check with your apache or web server setup on your system.
See also these mail archive posts
Files without a specific extension are not executed on some servers.
You may need to rename "fpwserv" to "fpwserv.elf" or "fpwserv.cgi" and update the fpw config file on your Windows computer accordingly.
A static LD is one that doesn't rely on libraries:
You can open .DEB or .RPM files on windows using 7-Zip. However the tar.gz file above contains the ld_static binary so that you do not need to extract from a .DEB or .RPM file.
Put the ld_static program in same directory as PPC386 on your webserver, and renamed it to just "ld". It should work fine. Or you can try using your own copy of LD from some unix system or zip file you find. The static copy doesn't require .SO libraries and therefore may be easier for you to get running.
Title: anything Program: cmd Params: /k fpw.exe programs/hello.dprAbove should work as a test for you.
Ultimately you'd want to set it up like this:
Params: /k fpw.exe programs/$NAMEONLY($EXENAME).dprAbove $MACROS won't work because of a slash problem (at least in delphi 5). Next release (0.0.3) will contain a workaround built into the fpw.exe program so the slash problem with delphi tools macros can be avoided.
Setting up other text editors is similar, and usually easier. Get to know the editors tools menu macros. Text editors do not have this slash problem, at least the ones we've tried.
Your desktop program, such as an IDE or text editor, invokes fpw.exe from a tools menu or a plugin. This fpw.exe program talks to fpwserv transparently, and acts just like a regular fpc.exe compiler. Instead of creating a windows executable on your computer, fpw.exe demands the server to create a web application. Your web application is immediately deployed on the server, from your offline IDE. Sounds tricky? It just works.
Once you have the IDE and server setup.. you only have to upload your project source files to the server when doing any web development, such as project1.dpr, unit1.pas, and unit2.pas.
It is similar to how you would upload PHP files to a server. However, with this system, you have strong typing, a real programming language, and an IDE like delphi, or a text editor. Many safety checks and type checks are done before the program goes live, whereas PHP would not offer these advantages (along with many security benefits in the API). Ultimately, it is much more powerful than php scripts since you can literally build any program you wish reusing existing delphi/fpc code and C libraries.
You could call it 'foopascal web' or 'freepascal web', if you like.
FPWSERV is the program that you upload to your typical CPanel or similar web server. FPW.EXE is the executable that runs on your Windows computer that talks to FPWSERV. It's kind of magic, and you don't necessarily need to know more intricate details of it.
Some similarities exist between CrossFPC in that both projects aim to target FPC/Linux transparently.
Cross compiling on a Windows computer means that the Windows computer creates a unix executable with a Windows compiler. As we have previously written articles about cross compiling, some may find cross platform deployment options confusing, since there is more than one way.
FPW/FPWSERV demands the web server to create the executable and deploy it. The server feeds back information to your IDE about the ultimate progress of the deployment or compilation. Since deployment is immediate if there are no errors, your web program can be tested immediately in your web browser by going to the URL such as yoursite.com/cgi-bin/prog.cgi.
Basically, both fakelinux and cross compiling are not directly related to fpw.exe and fpwserv. There are many ways to create unix executables, but fpw.exe and fpwserv offer advantages over fakelinux or cross compiling.
In fact fpw.exe and fpwserv can even be used along with fakelinux as another powerful combination, but that is another topic (you can run fakelinux with fpwserv and apache on it for local testing of unix web apps, but it is not required since you can run fpwserv on a Cpanel or similar shared hosting account directly).
Compile-Studio can be considered a gimmick or an emergency tool.. whereas fpw.exe and fpwserv are for professional offline IDE's. Compile-Studio is yet another way to make unix executables, not directly related to fpw.exe and fpwserv.
For example create program1.cgi for testing, and deploy program2.cgi or program.cgi for the actual live public program. This helps if for example program1 still has bugs and you do not want hundreds of public traffic hammering your program while you are still developing it. You may be familiar with this technique if you have developed PHP code or similar. A lot of broken PHP scripts exist because the programmer is developing it live while the public is viewing it, which is not always good practice.
To avoid hardcoding strings into your program such as 'program1.cgi' simply use the pwenvvar.pas units. Use SERV.ScriptName to obtain the current executable running.. this is similar to ParamStr(0) in console programs.**
** In older copies of Powtils the unit was pwuenvvar.pas, while the script name was acceessible via CgiEnvVar.ScriptName
Say you have a regular non-web program that you want to create for a cron job. So create a regular modern pascal program with fpw/fpwserv and use it.
The possibilities and power available with these remote tools are endless. You are not limited to just creating cgi programs or web programs.
Someone send Mac hardware for testing, to the developer please?
Email: L AT z505 . com
My relatives have a Mac that I can test on, if I don't end up getting one ASAP. Or I can buy one at a high price (fat chance). I you have urges and want this Mac business taken care of now, send me your Mac by postal mail right now. That would be the motivation that would send me to cloud nine.