mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
138 lines
5.2 KiB
Text
138 lines
5.2 KiB
Text
![]() |
<chapter id="introduction">
|
||
|
<title>Introduction</title>
|
||
|
<simpara></simpara>
|
||
|
|
||
|
<sect1 id="intro-whatis">
|
||
|
<title>What is PHP?</title>
|
||
|
<simpara>
|
||
|
PHP is a server-side HTML-embedded scripting language.
|
||
|
|
||
|
<para>
|
||
|
Simple answer, but what does that mean? An example:
|
||
|
<example>
|
||
|
<title>An introductory example</title>
|
||
|
<programlisting>
|
||
|
<html><head><title>Example</title>
|
||
|
<body>
|
||
|
<?php echo "Hi, I'm a PHP script!"; ?>
|
||
|
</body></html>
|
||
|
</programlisting>
|
||
|
</example>
|
||
|
|
||
|
<para>
|
||
|
Notice how this is different from a CGI script written in other
|
||
|
languages like Perl or C -- instead of writing a program with lots
|
||
|
of commands to output HTML, you write an HTML script with a some
|
||
|
embedded code to do something (in this case, output some text). The
|
||
|
PHP code is enclosed in special start and end tags that allow you
|
||
|
to jump into and out of "PHP mode".
|
||
|
|
||
|
<para>
|
||
|
What distinguishes PHP from something like client-side Javascript
|
||
|
is that the code is executed on the server. If you were to have a
|
||
|
script similar to the above on your server, the client would receive
|
||
|
the results of running that script, with no way of determining what
|
||
|
the underlying code may be. You can even configure your web server
|
||
|
to process all your HTML files with PHP, and then there's really no
|
||
|
way that users can tell what you have up your sleeve.
|
||
|
|
||
|
<sect1 id="intro-whatcando">
|
||
|
<title>What can PHP do?</title>
|
||
|
|
||
|
<para>
|
||
|
At the most basic level, PHP can do anything any other CGI
|
||
|
program can do, such as collect form data, generate dynamic
|
||
|
page content, or send and receive cookies.
|
||
|
|
||
|
<para>
|
||
|
Perhaps the strongest and most significant feature in PHP is its
|
||
|
support for a wide range of databases. Writing a database-enabled
|
||
|
web page is incredibly simple. The following databases are currently
|
||
|
supported:
|
||
|
<blockquote>
|
||
|
<simplelist columns=3>
|
||
|
<member>Adabas D</member>
|
||
|
<member>dBase</member>
|
||
|
<member>Empress</member>
|
||
|
<member>FilePro</member>
|
||
|
<member>Informix</member>
|
||
|
<member>InterBase</member>
|
||
|
<member>mSQL</member>
|
||
|
<member>MySQL</member>
|
||
|
<member>Oracle</member>
|
||
|
<member>PostgreSQL</member>
|
||
|
<member>Solid</member>
|
||
|
<member>Sybase</member>
|
||
|
<member>Velocis</member>
|
||
|
<member>Unix dbm</member>
|
||
|
</simplelist>
|
||
|
</blockquote>
|
||
|
|
||
|
<para>
|
||
|
PHP also has support for talking to other services using protocols
|
||
|
such as IMAP, SNMP, NNTP, POP3, or even HTTP. You can even open raw
|
||
|
network sockets and interact using other protocols.
|
||
|
|
||
|
<sect1 id="intro-history">
|
||
|
<title>A Brief History of PHP</title>
|
||
|
<simpara>
|
||
|
PHP was conceived sometime in the fall of 1994 by Rasmus Lerdorf.
|
||
|
Early non-released versions were used on his home page to keep track
|
||
|
of who was looking at his online resume. The first version used
|
||
|
by others was available sometime in early 1995 and was known as
|
||
|
the Personal Home Page Tools. It consisted of a very simplistic
|
||
|
parser engine that only understood a few special macros and a
|
||
|
number of utilities that were in common use on home pages back then.
|
||
|
A guestbook, a counter and some other stuff. The parser was rewritten
|
||
|
in mid-1995 and named PHP/FI Version 2. The FI came from another package
|
||
|
Rasmus had written which interpreted html form data. He combined
|
||
|
the Personal Home Page tools scripts with the Form Interpreter and
|
||
|
added mSQL support and PHP/FI was born. PHP/FI grew at an amazing
|
||
|
pace and people started contributing code to it.
|
||
|
|
||
|
<simpara>
|
||
|
It is hard to give any hard statistics, but it is estimated that
|
||
|
by late 1996 PHP/FI was in use on at least 15,000 web sites around
|
||
|
the world. By mid-1997 this number had grown to over 50,000.
|
||
|
Mid-1997 also saw a change in the development of PHP. It changed
|
||
|
from being Rasmus' own pet project that a handful of people had
|
||
|
contributed to, to being a much more organized team effort. The
|
||
|
parser was rewritten from scratch by Zeev Suraski and Andi Gutmans
|
||
|
and this new parser formed the basis for PHP Version 3. A lot of
|
||
|
the utility code from PHP/FI was ported over to PHP3 and a lot of
|
||
|
it was completely rewritten.
|
||
|
|
||
|
<simpara>
|
||
|
Today (mid-1999) either PHP/FI or PHP3 ships with a number of
|
||
|
commercial products such as C2's StrongHold web server and RedHat
|
||
|
Linux and a conservative estimate based on an extrapolation from
|
||
|
numbers provided by NetCraft would be that PHP is in use on over
|
||
|
150,000 sites around the world. To put that in perspective, that
|
||
|
is more sites than run Netscape's flagship Enterprise server on
|
||
|
the Internet.
|
||
|
|
||
|
<simpara>
|
||
|
Also as of this writing, work is underway on the next generation of
|
||
|
PHP that will utilize the powerful Zend scripting engine to deliver
|
||
|
higher performance, and will also support running under webservers
|
||
|
other than Apache as a native server module.
|
||
|
|
||
|
</chapter>
|
||
|
|
||
|
<!-- Keep this comment at the end of the file
|
||
|
Local variables:
|
||
|
mode: sgml
|
||
|
sgml-omittag:t
|
||
|
sgml-shorttag:t
|
||
|
sgml-minimize-attributes:nil
|
||
|
sgml-always-quote-attributes:t
|
||
|
sgml-indent-step:1
|
||
|
sgml-indent-data:t
|
||
|
sgml-parent-document:nil
|
||
|
sgml-default-dtd-file:"../manual.ced"
|
||
|
sgml-exposed-tags:nil
|
||
|
sgml-local-catalogs:nil
|
||
|
sgml-local-ecat-files:nil
|
||
|
End:
|
||
|
-->
|