What programming language should I learn?
That depends on what kind of programming you want to do:
Client-side (windows applications, linux applications)
The easiest language to learn if you want to do client-side programming is probably Visual Basic or Delphi. Some argue Visual Basic is for newbies only, and they might be right. Software like Word and Windows are written in C and C++ which are a lot harder to learn. If you want to write applications which run on any platform (Windows, Macintosh, Linux) Java is the best language to learn.
Server-side programming (forums, guestbooks, content managing systems)
If you want to write a guestbook, newsscript or content managing software you'll need to learn a language that runs on your webhost. Traditionally the most used is Perl, a language that is becoming more and more popular today is PHP, merely because it's incredibly easy to learn and comes with a large set of functions which makes programming easier. And of course there's VBScript if you want to code using Microsoft's ASP.
If you intend to do programming for big businesses or sites generating major traffic you might want to look into more scalable solutions such as JSP, Servlets or Coldfusion.
General purpose (both client- and server-side)
If you want to learn one language that can do both server and clientside programming you have a couple of options. Most suitable are Perl and Java. But of course running C programs through CGI is possible so you could learn C too.
What's the difference between CGI and Perl?
People tend to confuse CGI and Perl. Now what exactly is CGI and what exactly is Perl? They're completely different things and technically they have nothing to do with eachother. CGI (Common Gateway Interface) is a protocol which allows interaction between webserver and programs on the server. It's most commonly used to forward perl script output to your webbrowser. So here's how it works. You, using your browser send a request to the webserver to run some kind of perl script. The webserver therefor runs perl to execute the script, waits until it's done, then sends the output back to the browser. That's all, nothing more nothing less. So CGI is the protocol, Perl is the programming language.
What's mod_perl, mod_gzip and mod_php?
Apache, the most used webserver on the internet, allows you to write plugins or MODules. Two of them are mod_perl and mod_php, but another well known one is mod_gzip.
mod_perl
mod_perl integrates Perl into Apache. That means scripts no longer run through CGI but are handled by the webserver itself. That also means perl does not have to be started each time someone requests a perlscript generated page. Making the server respond a lot faster. mod_perl also allows kinds of caching, persistent database connections and a few things more. Not many hosts have mod_perl installed because not just any perl script runs using it. There are a couple of things the coder has to take into account, and not many did.
mod_php
mod_php is the module that integrates PHP into Apache. Nearly all hosts supporting PHP have this one installed. It works just the same as the CGI version does. It also allows persisitent database connections (and if they compiled using the shared memory directive you can use shared memory, ie caching too, though not many did).
mod_gzip
For many, many years, browsers have been able to unzip gzipped html pages. Though no site really took that opportunity to make sites faster and consume less bandwidth. If you have mod_gzip installed you can easily take advantage of gzip compression. Which as I said will send your html pages to the user in a compressed (smaller) format.
Which one is faster, PHP or Perl?
People tend to confuse the way these scripts are being run and the speed of the compiler itself. Their compilers and interpreters are nearly as fast, there's no noticable difference. The main bottleneck that seems to make Perl slower is that it is being run through CGI most of the time, and if we're talking about PHP, we nearly always mean PHP as an Apache module. To tease the PHP advocates: Since mod_perl allows more optimization you probably could write way faster perl scripts than php scripts
Where can I learn language X?
Since there are always people who don't know the God of all search engines Google, here's a list of tutorials/interesting sites for each of the major programming languages:
PHP
PHP Manual Still unbeatable, not just the best reference for PHP there is, but also contains a nice starters tutorial
PHP Builder Has a lot of interesting PHP articles
Devshed PHP Has some nice tutorials
Perl
Perl Contains a lot of articles
Perldoc A very nice reference
Devshed Perl Perl tutorials
Perl tutorial Said to be good
CGI.pm tutorial
Perl with DBs
A pretty good DBI (DataBase Interface) tutorial
Python
Python.org Contains articles and tutorials
Devshed Python Python tutorials
Introductory Material on Python
The official python tutorial (written by Guido van Rossum himself).
Dive into python an advanced tutorial (as the name indicates) for people with programming experience.
python.faqts frequently asked questions
Global Module Index don't code python without it
Python quick reference needs a little updating
The Vaults of Parnassus Python Resources
Python library reference
The python cookbook
The "daily" python url if you want to know what's happening
Python performance tips
More python links
Java
Java Tutorials Learn the Java Basics
Devshed Java Java tutorials
JavaWorld The best source for all kinds of Java articles
Regular Expressions
Nice (perl)regex tutorial
Perl regex examples
General
Tutorialsearch
I'm looking for a script that can do X
Before you ask, make sure you first checked out the following script archives:
CGI ResourceIndex
PHP ResourceIndex
HotScripts
Perl archive
Google (just search
Which editor should I use?
HTML
1st page 2000
PHP
Check out one of these topics: click click click click click click
Phpide (now registrations required)
PHP edit (registraton required)
KPHPDevelop (Linux)
Zend Studio Personal
Perl
DZ Soft Perl Editor (commercial)
(commercial)
Optiperl (commercial)
Perl Code Editor (free)
Xemacs + Cperl-Mode (especially in the Cygwin version for Windows and the native version for Linux a great editor - yes it can do other things to)
Multi-purpose
EditPlus (commercial)
Synedit
Xemacs
Vim
Jedit (java based and many plugins)
Context
Ed for Windows (commercial)
Ultraedit (commercial)
Textpad (commercial)
EditPad Pro (commercial)
BBEdit (lite version is free)
Omnipad written by Josh (and he forced me to put it here, honestly
and not to forget
Notepad - (bundled with Windows)
How to test my scripts locally?
A excelent guide on installing the Apache web server locally can be found here: Apache Win32 Install Guide. Or this exelent one, or this one, if you want to setup PHP on IIS, check this tutorial out. Bundles that do this automatically for you:
Easy PHP
Firepages
Foxserv
AppServ
Where can I learn regular expressions
Check these sites out:
http://www.webreference.com/programming/php/regexps/
http://www.phpbuilder.com/columns/dario19990616.php3
http://www.devarticles.com/art/1/106
What's the difference between Javascript and Java?
Well actually, they have nothing to do with eachother. The new name of Javascript is ecmascript which is a better name, though rarely used. The syntax of Javascript and Java look a bit the same, they're both object oriented. The difference is that typically you use javascript for simple client side scripts that you put into your html pages for validating forms etc. Java can be used for many purposes. It can do client side applications (word processors, editors, administration software etc.), server side processing (JSP, servlets) and you can create so called applets with it (small applications being run on a website, client side).
-----------------------------------------------------------------------------------------------
Installation Guide for Apache / PHP / Mysql / Perl
This is just the basic installation for Windows with pre-compiled binaries.
Disclaimer: I am not responsible for any damage this guide could cause to your pc. I successively installed the packages and wrote down how to set
them up correctly. I got it working but I cannot guarantee that it will run and work for you as well.
If you have further questions PM or email me csobetzko@gmx.de
1.) Downloading all the needed packages
Apache
Download: http://httpd.apache.org/dist/httpd/binaries/win32/
Current Version is 1.3.22
Perl
Download: http://www.activestate.com/Product....ivePerl
(select the version for your OS)
PHP
Download http://www.php.net/
Current Version 4.1.0
Mysql
Download: http://www.mysql.com/downloads/mysql-3.23.html
2.) Installing
Apache and ActivePerl come as a msi installer file so installing should be
easy.
When asked during the Apache installation for Network Domain, Server Name,
email use the following settings:
Network domain: something.com
Server Name: 127.0.0.1 (this is a MUST)
email: you@somedomain.com
Mysql is a zip file and needs to be extracted to a temporary folder. Then run setup.exe and follow the instructions.
3.) Configuring
PHP
Go to the folder where you have installed PHP.
There should be a file named php.ini-dist
Copy it to the your windows directory and rename it to php.ini
(See the file install.txt for installation instructions for Win 98 / 2000)
Now edit the file php.ini with an editor of your choice:
Goto the section Language Options and check if there is line that reads
engine = On
Goto the section Paths and Directories
--------
Change the include path to where your include are located for example:
include_path = ".;x:\folder\with\includes;X:\Apache\htdocs"
The "." means the current directory.
You can add more directories but separate each directory with a ";"
Change the doc_root to something like this
doc_root = "X:\apache\htdocs"
This should point to the path where you installed Apache server
Change the extension dir to
extension_dir = "X:\php\extensions"
Setting up the settings to use sessions
Around line 670 find
session.save_path = /tmp
change this to
session.save_path = X:\directory
The path is the typical dos path with no escaped slashes.
That should be enough to have a standard PHP installation running.
Apache
After you have successfully installed Apache go to the folder in which you installed Apache. Then change to the folder conf and edit the file
httpd.conf with an editor of your choice.
I will mention the most important lines. I have already installed apache and change it a bit so i cannot give exact line numbers. sorry
ServerRoot "X:/Apache"
This should point to the directory where Apache.exe is located.
Under Section 2:
ServerName 127.0.0.1
This should be the same for everyone.
DocumentRoot "X:/Apache/htdocs"
This is the folder where for example your PHP files are located.
<Directory "X:/Apache/htdocs">
Should be set to the same directory as DocumentRoot.
ScriptAlias /cgi-bin/ "X:/Apache/cgi-bin/"
The main cgi-folder.
Note: This has nothing to do with the first line of every perl
script.
Setting up Apache to parse PHP files
First of all, you need to have PHP installed.
Then add under the section AddType:
ScriptAlias /php/ "X:/folder/to/php"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
AddType application/x-httpd-php-source .phps
And to use cgi and shtml files uncomment the lines that should be located a bit below the addtype thing:
before
#AddHandler cgi-script .cgi
#
# To use server-parsed HTML files
#
#AddType text/html .shtml
#AddHandler server-parsed .shtml
after
AddHandler cgi-script .cgi
#
# To use server-parsed HTML files
#
AddType text/html .shtml
AddHandler server-parsed .shtml
This should be enough to have a basic Apache Server with PHP and Perl support running.
Try out by running the link "Start Apache in Console".
If you see a window with a dos icon that reads "Apache/1.3.22 (Win32) running ..." then you have successfully installed Apache.
Now let's try to get our first php script running.
Open an editor of your choice

