PDA

View Full Version : How Can I Start Server Side Scripting?



ASPHP
07-24-2002, 09:38 AM
I am a beginning WEB developer, and I would like to get to know a little bit of a server side programming language such as PHP to build a guest book. I found out that I need a server, so I downloaded Apache, from apache.org. Unfortunately, the comments were very confusing, and I ended up deleting it. I don't have a domain name, but I heard it's possible to have a small server on your computer. Currently, I don't have a web domain, so if preferable, I would like to keep all of my scripting in My Documents.

My question is, does anyone know a good place for me to start server side programming, a site/reference for beginners, a clear guide to Apache or another server. Do I need any software requirements to start writing PHP scripts besides a server( and what programs make up a server?)

Also, if I download a server, what does it mean when it is running?

Kennis
07-24-2002, 12:05 PM
You should download PHPTriad. Do a search for it on http://www.download.com, download it, and install it.

It will install PHP, Apache and mySQL for you. Now you can run all your PHP scripts from your local drive. You should probably pick up a copy of Beginning PHP 4 by WROX Press or some other publication, just to get an idea of the basics.

firepages
07-24-2002, 08:06 PM
All you need to test your PHP scripts offline is a server and PHP, preferably a DB as well once you get past the basic configuration of the server its pretty straightforward.

& since phptriad is now no longer being developed you may like to try phpdev (http://www.firepages.com.au/dev4.htm) ;) but I would say that !
(phptriad is just as good & still available as noted by Kennis (not as good as phpdev5 will be though!))

uranusalien
07-25-2002, 09:58 PM
Go to opensa.org and download. The BINARIES.
Then, configure httpd.conf to your needs, or you might try comanche (comanche.org).

opensa has in-built PHP support and Perl support with minimal effort as long as you have installed perl.

Now, download the following:
Mysql-max 4.x or Mysqld-max 4.x. or whatever BINARIES.
ActiveState Perl (activestate.com)

Install it all.
Configure and tailor httpd.conf and php.ini to your needs and you're ready to go.

If you plan on running forums or similar, you may want to consider also running a SMTP email server. Try inetsrv (3.x). If you can't find it (it seems to have dissapeared off the web) PM or Email me and I will send it to you.

If i remember correctly, the .php extension i configured and ready to go for PHP scripts on openSA, but you might also want to enable support for .php3 since some scripts use it and you won't have to go to the trouble renaming and replacing in files.

If you come across scripts, that do not seem to work, or not seem to be picking up GET or POST input (and they look like they're missing $var = $_GET[var]; etc.) they were probably written before the existance of PHP 4.2.x and you will have to turn register_globals on in PHP.ini to make them work, or give them serious manual modification. Enabling register_globals IS a security risk.

When writing scripts yourself with register globals on, you must be aware of loopholes like this:


if ($admin_pw = "catanonymous")
$password_ok = 1;

if ($password_ok) {
// admin stuff
// ...
}

Anyone could just go to the script,example.php?password_ok=1 and it would work and allow them admin access.
To prevent this loophole:


if ($admin_pw = "catanonymous")
$password_ok = 1;
else
$password_ok = 0;

if ($password_ok) {
// admin stuff
// ...
}

And you would be secure.

From this, I hope you can see why register globals is insecure. THINK when turning it on.

Have fun with php.