Comparison of [web development] PHP advantage - PHP and ASP.NET

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Comparative advantage - PHP and ASP.NET PHP

Now when it comes to Web development, You have many choices. Many of these methods are related to the pretreatment of — i.e., Using specific markers will code embedded in a HTML page., These signs tell the preprocessor, They contain code, And deal with them to handle. Very similar to CGI, The code runs on the server, And return the content, These content is sent back to the browser the HTML page design. The framework of ASP.NET open source scripting language PHP and Microsoft in the language are of this type; JavaServer Pages (JSP) and Perl/Mason are running in this way.

In this paper, I will focus on the PHP — Oracle has been chosen into the technology of &mdash in its products; and ASP.NET. I will outline the various strengths and weaknesses, and focus on those will help you decide the development projects should choose what kind of technology factors. There are many factors need to be considered, different projects may resort to different technology. In short, you will see the price, speed and efficiency, safety, and cross platform support and other aspects of the item by item, and open source solution advantage.

What is ASP.NET?

The most recent version of ASP ASP.NET does not fully with earlier versions of ASP backward compatibility, Because the software has been completely rewritten. In common with earlier ASP technology actually with PHP than with ASP.NET is much more common, ASP.NET is used for a complete framework for building Web applications. One of the main characteristics of this model is the choice of programming language flexibility. ASP.NET can use scripting language (such as VBScript, JScript, Perlscript and Python) as well as compiled languages (such as VB, C#, C, Cobol, Smalltalk and Lisp). Use the common language runtime environment in the new framework (CLR); the first compile your language source code into Microsoft intermediate language code, CLR then execute the code.

This framework also provides a true object oriented programming (OOP), and to support the real inheritance, polymorphism and package. The.NET class library based on specific tasks (for example, the use of XML or image processing) tissue into the inherited class.

In addition to the programming language and method, database access is a factor to be mainly concerned with. When you use ASP.NET programming, ODBC can be used to integrate the database; ODBC provides a consistent set of call a function to access your target database.

Strengths and weaknesses

The advantage of ASP.NET obviously lies in its simplicity of design and implementation. This is the object-oriented programming personnel's dream: language is flexible, and supports the object-oriented features of complex. In this sense, it can actually make existing skills and programming staff interoperability.

Another advantage of ASP.NET is its development environment. For example, developers can use the WebMatrix (a community support tool), Visual Studio.NET or Borland tools (such as Delphi and C++ Builder). For example, Visual Studio allows setting breakpoints, tracking code and see the call stack. To make a long story short, it is a complex debugging environment. Many of the other third party ASP.NET IDE solution will inevitably.

But you got the robustness, took the loss of efficiency at the expense of. ASP.NET in the use of memory and execution time is very large, the code path to owe much longer. The Web based applications, these limitations can be a serious problem, because in Web, your application may be extended for tens of thousands of users per second. Memory usage also may become a problem on a Web server.

What is PHP?

PHP is a scripting language HTML page model based on pretreatment. When the PHP pre processor in the Web server PHP language tag like this, will call the PHP engine to execute the code:


some code here


Any use of imperative programming language programmers will be very familiar to PHP; you will find it with Perl, C and Java similarity in terms of grammar. Strictly speaking, Java is an imperative programming language, but it also makes use of the structure and object-oriented concepts. PHP borrowed this structure at the appropriate time, but it is not a pure OOP language.

In the above discussion on ASP.NET., I mentioned the ODBC driver, And in consideration of how to construct the application situation of database abstraction. In PHP, You can also use ODBC and database dialogue, So you have a series of supporting database options. There are MySQL, native Oracle and Postgres driver. In addition, If you want to use Oracle, There is a special OCI8 library will provide more access function of Oracle, It allows you to use such as LOB, BLOB, CLOB and BFILE etc.

Then you may ask “ why and database related database called the characteristics of PHP? ” database abstraction and independence are you trying to build multiple databases or need to transplant in the database (for example, from development to production of transplant) a factor which must be taken into account when the application. And these are indeed should concern and consideration.

But as Tom Kyte in his book — Effective Oracle by Design (Oracle) — points out, Database correlation will become your real goals, Because this will allow you to maximize the technology investment. If you are on Oracle for general access to the — either through ODBC or Perl DBI Library, Then the characteristics you will not be able to use other databases do not have. In addition, Query optimization in database of all different.

Zend Technologies is a commercial software company, It has made a significant contribution to PHP. It creates a called Zend Studio business development environment, This environment includes a complex of the debugger, a monitor and other characteristics. The company also established a free Zend Optimizer, It with the Zend Encoder used to compile the PHP code, In order to improve the performance of. There are other commercial products, Such as Zend Performance Suite, It can cache pre compiled PHP page, In order to further improve the overall performance.

Strengths and weaknesses

To test version 4., PHP 5 still has some disadvantages, Including lack of anomaly and &mdash error handling routines based on event; they can interrupt normal program flow, And the code jumps to a special error handling. Java also provides for exception handling, While the C++ through the try, catch and throw provide exception handling syntax. Of course, You can still manage errors in PHP, But its structure is not standardized, So the programmer must use their own tools to decide to implement error handling way, This will lead to consistency lower and often leads to start again.

Another weakness is the PHP function names are not case sensitive. Although this is not a serious drawback, but some programmers may find this feature very hate.

However, I do object model of PHP doubts. PHP is not designed for an object-oriented language. Some of these characteristics is later added — although attention to keep the backward compatibility with the PHP 3, so that the characteristics of the two models were left with some. In fact, in PHP 5, many of these weaknesses have been resolved. Please pay attention.

What PHP is missing in some areas, it will be in the areas of expertise quickly make up for anything. The price is reasonable, so you don't need to worry about licensing issues. It is open source, so that the whole community will pay close attention to the development process: find errors and its repair. If there is a feature that you don't like, then you can modify the code. In addition, PHP can be naturally combined with Apache: it can be used as a module compilation, or compiled directly into the Apache binary files.

But in the Apache run means, Using PHP, You can use you have to invest in any server, This is because the Apache can run on Windows, Linux, Solaris and various other Unix platforms. In addition, With Apache track record of web server means security can be maintained at the highest priority. Last, The code path PHP has smaller, This means that the analysis and implementation of PHP page server code less, This will lead to more efficient memory and use rate and faster running.

In the new PHP 5 what characteristics?

5 PHP fourth beta launched in 2003 12 at the end, the change log clearly show has found that many of the error and the elimination of. Although it is still being tested, but all of the new characteristics and progress of which are worthy of attention.

The main achievement of PHP 5 is its exception handling and a new object, the new object into the characteristic has given PHP the real OOP. Exception handling is one of the most significant defects in PHP 4, and PHP exception handling into the 5 on is a sign of maturity. Exception handling means you in your software has according to the error processing method defined in the language standard. Just use the try, catch and throw, your PHP code is more robust and simple.

<?phpclass blue {function openFile ($inFile)

{if (file_exists ($inFile))

{# code to open the file here} else {throw new Exception ("Cannot open file:$inFile");

} }}

$blueObj = new blue ();try {$blueObj->openFile ('/home/shull/file.txt');}

catch (Exception $myException) {echo $myException->getMessage ();

# rest of exception handling code here}# rest of blue methods here?>

The new object model to bring many positive effects of the program written by PHP. In PHP 4, when passing an object to a function or method, is passed through the value of the — unless you otherwise explicitly told PHP. This means that a copy must copy object (all the in memory data structure). This step uses the access memory, slow and congestion. In PHP 5, usually pass objects by reference.

Object oriented characteristic of new 5 PHP (including the constructor and destructor) worthy of attention. Same as C++ and Java, and they provide a standard way, namely by a constructor to create the object, the allocation of memory and perform any necessary settings, and through a destructor method to perform cleanup.

PHP 5 also introduces more fine control method and variable in the class. In PHP 4, all Public: you can outside or in the derived class access to your class from a class variable. In PHP 5, you can still make the variable or method for the public, but you can make them as private, so only in the class itself to use them. They can also be Protected, that is to say, can be in class or in class view methods and variables.

In addition, PHP 5 introduces the types of cues or better type checking. When you pass an object to a routine, PHP can check whether it is the correct type, and generates a type mismatch errors in check fails.

Since there are other characteristics (such as static variables and methods as well as the abstract class), so be sure to view the document, to get more information.

Safety comparison

The official ASP.NET requires that you use the IIS. Unfortunately, The historical long-standing IIS vulnerable, This makes many administrators are not willing to deploy it to handle Web site. These weaknesses because Microsoft defects or because the IIS is the hackers attack be of no great importance: these systems have been black or assault history. PHP also runs on Apache, Apache fast and is open source code, And has a good safety record. In addition, As I mentioned, Apache can run on many platforms.

If you consider the ASP.NET, but you want to use Apache Internet as a gateway, so lucky you can have some choice. First of all, you can use the Apache forwards the request to the operation in the IIS on the other computer. Then the Apache static content, and ASPX content will be sent to the IIS server (not exposed to Internet).

However, if you want to load ASP.NET using Apache, then provides some options, these options may or may not support Microsoft support. As the last option, Ximian Project Mono, it is committed to building an open source code modules. Please read the, in order to get more information.

Database code example

You are using PHP or ASP.NET connection when the first factor is with the database. However, using ASP.NET is more complicated, because you can choose a language from the many alternative languages. Of course, these code samples will be embedded in a HTML page, instantiate classes. However, the following information will enable you to understand the two coding style.

PHP 5 and Oracle connection

The following is a class 5 PHP, it provides a Oracle connection and disconnection routines, use PHP to demonstrate 5 (you can also use other driver (ODBC driver) and general database Interface) a way to connect with Oracle:

class oracle_object {

protected $theDB;

protected $user;

protected $pass;

protected $db;

function __construct($u, $p, $d) {

$this->user = $u;

$this->pass = $p;

$this->db = $d;


function db_open () {

$theDB = @OCILogon($this->user, $this->pass, $this->db);



function db_close() {




function __destruct () {

print ("so long...");



ASP.NET and Oracle connection

If you want to use VB.NET (Visual Basic is the default.NET Microsoft programming language) and Oracle connection, so please look at this from the MSDN example:

Imports System

Imports System.Data

Imports System.Data.OracleClient

Imports Microsoft.VisualBasic

Class Sample

Public Shared Sub Main()

Dim oraConn As OracleConnection = New OracleConnection

("Data Source=MyOracleServer;Integrated Security=yes;")

Dim oraCMD As OracleCommand = New OracleCommand



Dim myReader As OracleDataReader = oraCMD.ExecuteReader()

Do While (myReader.Read())

Console.WriteLine(vbTab & "{0}" & vbTab & "{1}",

myReader.GetInt32(0), myReader.GetString(1))




End Sub

End Class

Make a choice

If you had not decided to use PHP, I can assert that the PHP advantages far outweigh its weaknesses. (see Table 1 in summary.) These advantages attributed to price, speed and efficiency, security, cross platform application and open source opportunities. It's only weakness is the lack of a pure and perfect OOP implementation, however, this is a very small defects. Although the structure of language help, but good coding is ultimately determined by the practice, execution, good habits and norms bring.

Comparison of PHP and ASP.NET

Table 1




The price of software

Free of charge

Free of charge

Free of charge

Platform price

Free of charge

Free of charge

















Weak (only for IIS)




win32(Only for IIS)

Whether to provide source code



Whether or not


Whether or not








In this, We should not simply consider the initial investment for PHP —, It is obvious that the free — consideration should also be given to the implementation, maintenance and debugging cost. In the case of PHP, You may need to purchase Zend optimization engine. However, The use of ASP, You will begin to invest, And you also for the technology of &mdash added; for example, Implementation of graphics library — pay. But in the long run, PHP will not force you to upgrade and collect more licensing fees to you. Contact with each individual complex licensing all know, Many companies spend a lot of time and money only to ensure its compliance. In addition, When the error recovery time, You got the response is different. This course will be transformed into time, Time will be transformed into the overall development costs.

Speed and efficiency

As I mentioned earlier, ASP.NET is a allows you to use a variety of programming language Framework. In addition, The object-oriented model it is thought to have an excellent. Although all these things are true., But in considering the speed, It is bad. Based on the above reasons, Compared with the equivalent ASP page operation in the PHP engine PHP pages need to perform more code running in the ASP.NET. PHP is a “ fast rough ” solution, The solution is designed to complete the work. Although since 2 and 3 versions of the enhanced since many robust, But it still retains the high speed core optimization method.

Speed is not the only factor to be considered. Also very important memory usage.


ASP.NET running on IIS, While IIS has been attacked many times — confirmed as every other IT news report. It has become such a burden, In fact, Despite its expensive sales promotion, But many IT professionals still refused to use the IIS Web server to open their networks. Using Apache and PHP. Apache has a proven safety record of speed, reliability and security. Please visit, For more information.

Cross platform application

ASP.NET runs on IIS, and began to run in Apache (Apache can run on many platforms). PHP was designed from the outset to work with Apache, so you have many choices has been proven and reliable server platform.

Open source opportunities

Open source is not only some indulge in the wildest fantasy programmers or want to save some of the companies to carry out a license fee. When you deal with the software itself wrong, open source code may be a godsend.

In the use of PHP or ASP.NET in the case, You will have a large user group, They use the software and may encounter errors. The use of ASP.NET, These errors must be informed by an official procedures, repair, test, And in the elimination of a new patch or version. However, The PHP patch can quickly repair and release. Anyone who witnessed the open source development all know, The new version and patches usually within a few days and not as commercial software in a few weeks or months to launch. If this is not fast enough, Usually you can own to repair the problem (if necessary).

The advantage of PHP in WEB development.

Your current position: Du Lich old --> technical documentation complete     in most WEB developers eyes, ASP and JSP are considered to be a leader, While PHP was considered a weak “ struggle ”, Or that it is a door was relegated to the amateur to use language, Not worth it to participate in the enterprise WEB development competition. In my opinion, PHP is not as competitors reason is a lack of understanding of critics, But also don't understand for other operating system developed by WEB. Contrary to some opinions, WINDOWS no longer holds the largest share of WEB virtual host service market, I guess it in WEB development in this field has also been Cuichengbazhai.

In the enterprise development, why not PHP?

Obviously, PHP that was behind the ASP and JSP too much, It is no use, But this is inconsistent with the facts. PHP is a powerful language. There are in fact it in each release version of LINUX., In the MAC OS X has. Gets the development and use of PHP code of the component (BUILDING-BLOCK) tools and software are free. For commercial integrated development environment for developing PHP applications (COMMERCIAL INTEGRATED DEVELOPMENT ENVIRONMENTS, IDES) can also find such tools are KOMODO (it runs on LINUX and WINDOWS) and ZEND STUDIO (the application can run on any JAVA operating environment operating system). You can almost be established by PHP running on each virtual host on the WEB website, And don't consider running the server what operating system, This fact makes PHP more attractive.

PHP can provide.?

The first PHP around what to forget for a moment, and consider the PHP itself can provide what. It is a robust server-side language, can provide many functions, but also can provide service for the page.

Easy to use

The use of C or PERL or any user to another language with similar style and syntax are able to get up to speed on PHP. Although it is designed for use in WEB., But it can also be used as a command language. You are writing WEB applications require each hour or every day a certain code? The use of CRON or similar Planning Manager, You can schedule code in the PHP you want to execute, The use of ordinary command scripts or batch files can execute this code. You can view specific webpage does not require automatic call browser, In order to execute your event, There is no need to rely on the visitor clicks to tell your system: specific code needs to be executed at a specific time. In this field PHP scalability is the fact that the absolute attractive.

The benefits of PHP

Veteran I am not JSP or ASP, I don't want to belittle the language of these. Instead, I will focus on the benefits of PHP.


PHP allows you to provide localized service for visitors to the site. When the user clicks into sites, According to the web site will they browser settings automatically in the native language to the page. To achieve this point does not need to use for language translation complex file, The same but the ability to use and localization of C procedure with the, By implementing a system called GETTEXT. If there are requested language file, So the user can see the text is the native language; if the file does not exist, Then the text is the default English or any other language you specified. Many localization of UNIX applications on the GETTEXT as the standard, It allows third party translation becomes be an easy job to.

Easy to use the command line

PHP support set and execute a command line program where needed. Use standard UNIX DIFF tool, it can generate an error the last modification to the current annotation errors between the owners of the different email. PHP code DIFF on two documents prepared by the system, its output is used as input, regeneration into an e-mail message to send. This email is sent by PHP's own.

Other benefits

The above is only powerful function I use in my program in two, and other functions. For example, you can:

Instantly create a simple FLASH animation.

Instantly create PDF documents.

Use advanced mathematical function, and the object oriented programming technology.

Read and write to the local and IMAP mailbox.

In PHP you can use any of the standard INTERNET protocol. Want to write a PHP based FTP, WEB or news client? No problem! Use only PHP you can write using a standard TCP/IP socket client and server, and to create their own protocol.

Implementation of encryption support, and support for a variety of database server.

Lack of foresight.

I think, Those looking for a top WEB development language and exclude PHP is extremely short-sighted. I use PHP to write the code has been for many years, Both like a bug tracking system such advanced features, Or simply reuse the header and footer common functions such as, I have used PHP to write. I used PHP prepared half static page, Has also compiled a multimedia presentation full function. I'm not the only one who uses PHP. If the PHP is not worthy of attention, If it is a pediatrician or lovers language, That why it's the fastest growing language in WEB development? If it is not ASP or JSP so powerful, So why would it be used in a huge flow of the WEB website? For example, YAHOO, It is said that it was built by PHP.

Developers used familiar products

I'm sure, ASP and JSP have their own strengths, but I believe that people are using them not because they can provide more powerful functions than PHP, but because people already know them, and want to write code for your own custom. The exclusion of PHP can only be said of this language ignorance.

About the future of PHP

Translator's note: This is an article written in German on the PHP &ldquo, a long and minute statement; ” the PHP blow to the miraculous in the paper, a unify all corners of the country. And not to pipe it point of view is correct, such a classic “ brag curious ” for those of us with profound respect and humility PHP programmers, is worth a look at. And without further ado, let us begin to appreciate this cheat Qiwen.!

1 Introduction

Definition: PHP is a simple, object-oriented, interpreted, robust, secure, performance is very high, architecture independent, portable, dynamic scripting language. The PHP and Class keywords is similar to JAVA. Because there is no need for a virtual machine, so that the speed is 5 times faster than JAVA. PHP is rapidly becoming a standard, general-purpose, object-oriented scripting language. PHP not only can be used to develop Web application program, can also develop the common application.

PHP is a powerful scripting language. PHP will beat the PERL/Python and replace sb. PHP is the next generation of the PERL/Python script. PHP can do any PERL/Python work, and do more, better, more concise!!

PHP Hypertext Pre-Processor (Hypertext preprocessor) abbreviation, It is a server-side HTML scripting / programming language. The PHP syntax is similar to C, It can run in Apache, Netscape/iPlanet, and Microsoft IIS Web server. The PHP as a tool, Allows you to create dynamic Web pages. Application of PHP webpage and conventional HTML page., You can use the same way to create, edit them. PHP allows you to write simple script directly in the HTML file, This is very similar to the Javascript. But the difference is, PHP is not dependent on the browser, Is the server-side language, While Javascript is a client block in HTML language. The concept of, PHP and Netscape LiveWire Pro products, Microsoft ASP and SunMicrosystem JSP similarity.

PHP not only can be used to create a Web application, can also be used stand-alone application development ordinary.

A strong feature of PHP is that:

·PHP is one of the most outstanding technical. Other techniques, such as PERL, Python, Tcl, VB, script, ASP, relatively speaking, are old inferior. Even Java/JSP, also under the PHP.

·Open source

·A wide range of database connections

·A lot of extensions

·As a general-purpose scripting language, PERL, VB script, ASP, JSP are excellent.

Why choose PHP? Because the PHP is the best, the reasons are as follows:

·PERL“The flavor is not good, because the ” the program is not easy to read and maintain, and are not object oriented. The PERL forget, to PHP. PERL programmers will abandon PERL, because they fell in love with PHP! PHP actually is “ the modern version of the PERL&rdquo, just a different name;.

·Java is object oriented, but the speed is very slow. The Java program running slowly, it only complaint is that — — “ Java, is really bad &rdquo slow;. And very complex (with many layers, such as JVM, JIT etc.). This usually causes problems. Now that there is Linux, why is Java.?

·Python“Good, but not ” C language in brackets and braces, which in the VI editor to manipulate the code is very useful. If you can't use the vi/emacs editor search brackets / Braces command prompt handling code, then just like the broken hand. PHP is technically more advanced than Python.

·PHP is the best, because it is object oriented, and absorb the essence of C/C++/Java/PERL. PHP can replace PERL, Python, Java, C, C++, awk, Unix, shell script, Visual Basic and other languages!! PHP run directly, and is written by C.

·Every computer programmers know PHP is the best, not letter to ask you next to the programmer.

·Only PHP can rule the roost in the twenty-first Century, twenty-second Century and beyond.

·Why do we think of PERL, Python and Java programmers will join PHP, there is a very important reason.

Previously, many companies around the world as the PHP is a “ highly confidential, strictly confidential ” computer programming language, but now it has become the most famous, in Web, Internet, the most widely used E-commerce and B2B and other items on the object-oriented scripting language. Even today, there are still many competitive (competing), as the PHP is highly confidential things, not to the outside (rival) reveal.

PHP will be like a storm swept across the world, IT industry will be shocked. The strength of PHP lies in it is cross platform, can be run anywhere. Such as Linux, Windows 95/98/NT/2000/XP, Solaris, HPUX and UNIX. PHP just write once, can be arranged in any place. The PHP can run on Apache, Microsoft IIS and other Web server.

PHP 5 to 20 times faster than Java!! Comparison tests show the actual, PHP's speed is Java3.7 times. PHP is easy to use., You can use it in a very short time., Developed very quickly, very complex web, E-commerce and general stand-alone application. (in the future, PHP will mimic the Java most of the functions, Believe that Java programmers will like it. The PHP will contain the Java keywords, Such as class, Extends, interface, Implements, public, protected, Private etc. )

PHP has the character of object oriented, the absorption of Java, C++, the best part of PERL and C. PHP can be said to be the jewel in programming languages all scripts /. Soon, it will become the world programmer &ldquo ” mecca;. PHP can be run in Window95/NT/2000/XP, can run on a variety of UNIX.

We will be startled at — — PHP is very likely to become the twenty-first Century computer programming language.

You can use the Zend Optimizer to PHP compilation and optimization is performed, so as to make it run faster. Zend Optimizer has integrated PHP4.0. First of all, you are developing, testing, debugging process, using PHP scripting language to compile your application. Once the project is completed, you can use the Zend compiler, compiling the PHP files to run faster executable program.

For the electronic commerce project, the comprehensive use of PHP you need to (70%), HTML/DHTML/XML (25%) and 5% Javascript (client side validation).

2.PHP can be run in Microsoft Windwos!!

PHP was running on the UNIX platform, but its portability is very good, can also run on Windows and IIS Web server. Today, a large number of Windows based 2000/NT/95/98 PHP users have, you can find a lot of running on the Windows platform of PHP tools.

Many PHP programmers like to develop them in the Windows process, after the completion of the configuration in the large Linux servers, such as Linux IBM Compaq DEC Alpha minicomputer, and Sun SPARC.

Is the biggest advantage of PHP, it can also run on UNIX/Linux, UNIX developers can for users of the PHP service MS Windows, and Windows to develop the PHP code can also be without any change, for UNIX/Linux.

PHP itself is written in C language, so it can be widely used in run on various platforms, such as BeOS, UNIX, MS Windows, Apple Macintosh, IBM OS/2 and many other operating system.

PHP runs very fast, faster than Java a lot. For Web development, not forget Java/JSP! PHP, PHP, everywhere will be PHP! PHP also will become a kind of object-oriented general-purpose scripting language.

3.PHP Download

·The main PHP site:

·The PHP resource:

·PHP code exchange:

·Vex Net:

Have a mirror site in many countries, the address is, where COUNTRYCODE is us, Fe, SK, etc.




·Answering email address:

3.1 PHP installed in the Microsoft Windows 95/98/NT/2000.

PHP is very popular in Microsoft Windows platform, And the other is amazing, It is Microsoft's own Web script language more popular. The reason is that PHP is an object-oriented scripting language, And ASP is not. PHP has a large number of reusable classes (object), On the platform of Windows, PHP should be much faster than ASP, It has more functions and features than ASP. PHP is more robust than the ASP, More reliable, More powerful. Because PHP can be run on MS Windows, Linux, Mac OS and all UNIX, So it has a huge user group. And its biggest advantage is, You can develop a program in Windows, Then the configuration in the UNIX/Linux, And vice versa.

Windows98/NT/2000 PHP users than any other operating system, because it is very simple to install PHP on Windows98/NT/2000.

PHP installer executable, you just double click the EXE file, 2 minutes can be automatically installed. You can download the executable PHP setup program from the following stations:

·Windows under the PHP executable setup:

·Under the platform of Windows PHP data:

·Installation and configuration of PHP under Windows:

·PHP Triad can be installed complete Windows platform in the PHP services environment:

3.2 in the Windows 95/98/NT/2000 rapid installation of Apache Web server (10 seconds)

Running PHP on Windows, you need a Web server, you can use Microsoft IIS, can also use the free Apache. Because can be installed by Apache setup file setup.exe, you can save a lot of time.

PHPTtriad is a Apache, PHP, MySQL software package, available from the download or mirror site. I strongly recommend the use of PHPTtriad, it is very popular among Windows users (has been downloaded millions of times).

The Apache binary:

Microsoft SQL server 3.3

The SQL server can be installed on the do not need to run Windows on a machine, but you also need a SQL server for Web development. I recommend you in very old PC (such as Pentium or 486) install Redhat Linux and PostgreSQL RPMs. Your database does not need any Windows graphical interface, can start PostgreSQL directly in the console. The speed of PostgreSQL is about 3 times Oracle and MS SQL server.

PHP PostgreSQL support library is written by Adam Sussman, his email address is:

Support Windows NT/2000 PostgreSQL can be downloaded from. The guidelines obtained using PostgreSQL .

3.4 PHP installed in the UNIX and other operating system.

See the PHP Master points on the installation guide and explanation, or download software package INSTALL file.

The 4 quickly advanced

Using object oriented mechanism of PHP, a project of the steps are as follows:

·First of all, you need to connect to a SQL database server — — there are two choices:

ADODB (Active Data Objects Data Base), The dynamic data object database( )

Metabase(Database independent access and management),The database independent access and management(

·Second, some generic PHP class to create a form you need, forms and other HTML objects. These can be obtained from the PHP classes website (). You can refer to the download list. You can also get a form class from the site, templates etc.

·Third, through to the inheritance of these general class, to design and create your own PHP class.

·Fourth, the use of templates to separate the display style and business logic, see

·Fifth, the use of IDE development tools (see the PHP IDE section).

·Finally, it is best to keep your code package into categories, which can implement the code maintainability and reusability.

The main characteristics of 5.PHP

·Support the standard CGI, FastCGI and Apache module — — as a standard CGI program, PHP can be installed on any UNIX machine running any Web server. PHP support the new FastCGI standard, through this mechanism, PHP obtained the fast. When configured as a Apache module, PHP is a powerful, running speed of lightning fast new choice.

·Access log — — access through the PHP log, the user can maintain their clicks and log. This feature provides access to real-time monitor, instead of using the system in any way center access log file. A set of pages for individual users log view script has provide quick access to the. In addition, the package can also be configured to generate a footer for each page (footer) to display the information access. Can refer to the example.

·Access control — — a built-in Web configuration based on “ &rdquo zeolite;, Can realize the access control configuration. Such, It is possible to create a set of rules for all or part of the Web page, Make certain those pages can set various restrictions on his webpage, Such as, What kind of people can access these pages and the pages in what a way to be accessed. The settings page there are many ways, Such as password protection, limit, login failure, or more to the customer's domain, browser, e-mail address or other document is set according to.

·Support for PostgresSQL— — PostgresSQL is an advanced but free RDBMS (relational database management system). PHP support in the.Html file directly into the PostgresSQL “ SQL query”.

·Support RFC-1867 file upload — — file upload is a function of the Netscape2.0 new. Users can upload the file to the Web server.

PHP provides the actual MIME decoding function, make the file upload is possible. PHP also provides additional frame, which can carry out some useful processing on the received file uploads.

·HTTP authentication based on control of — — PHP can be used for authentication mechanism based on HTTP to create a custom Apache server.

·Variables, arrays, associative arrays (associative arrays) — — PHP support typed (don't know how to translate this word, hope master pointing) variables, arrays, associative arrays and Perl style. These can be passed to another page from a page with a GET or POST method of the form.

·Conditional statements, While — — PHP is a similar C language function complete script language. You can use the if/then/elseif/else/endif statement, Switch/case statement and While cycle and to arrange the logic process of HTML page display.

·Extended regular expression — — regular expressions frequently used in pattern matching, pattern replace and string operations in general. PHP supports all the regular expression commonly used operations.

·HTTP Header control the original — — based on some condition, make Web pages to the original HTTP head sends custom is necessary for some advanced website design. A common usage is to send a Location:URL header, the request is redirected to another URL client. Can also be used to HTTP header cache or operation page update closure.

·Dynamic creation of GIF — — PHP has support for Thomas Boutell GD picture library, can realize the dynamic GIF image creation.

·Support for ISP“ &rdquo security model; — — PHP support unique “ safe mode ”, thus enabling multiple users running on the same server PHP script to be more secure.

·Adds a new release of the PHP in many new features. Visit PHP's main site

·PHP is free! — — this is the last important characteristics. The PHP package is completely free. It complies with GNU/GPL. You can use this software for business or for any other purpose.

5.1 PHP compared to the advantages of Java

PHP is a kind of have been confirmed, used to create dynamic webpage server side scripting language. As a kind of special design for Web language, PHP has brought the characteristics desired of many commercial establishments.

·Short maintenance cycle

·The fast development time

·Very high performance

PHP can in all major platforms (UNIX, Windows, and even large machine) on the run, and was born to support a variety of popular database. All of this decision and it is a development of the Web ideal: it has been using the technology of PHP online store says, will be able to develop reusable code within a few days. Those familiar with C, C++ or Java language programmers, it is discovered that they could be PHP programming in a few hours.

PHP is designed for Web development, this fact makes it a unique development tools, like Intranet Design magazine.:

“PHP is built on top of the Web developers real demand.... unlike most heavy, high load, PHP is very light, is developed for the Web solutions. It can be faster than other similar technology, more easy to solve complex problems. ”

Java is a new programming language, Originally used to run embedded in the browser of the client application. In the past few years, “ applet” problems forced the SUN and other Java developers to find a new way out for the language. The most prominent is the server-side programming for the, It allows the Web site to connect to the database and generate other application server, “ servlets”. SUN finally launched the Java Server Pages (JSP) as a means of compiling servlets. As with the PHP, JSP also has high portability between different platforms (although PHP supports any 32 bit and 32 bit above the platform, While JSP can only run on a Java virtual machine installed on the platform). Then, No programming background novice will find, The use of servlets programming is a very difficult thing to do, Because of the language and the complexity of JSP complex system design.

The performance of JSP also has a lot of room for improvement: a recent survey of the online journal eWeek ZDnet, the running speed of PHP is almost 3.7 times of JSP. Can say, JSP is a kind of solution in Web environment is very poor, this is because it can only handle a few transactions per second, and the response speed is very slow.

ZDnet eWeek magazine said:

“JSP is a relatively new technology, resources from the development tools,, talent, not complete market maturity. ”... Because JSP is based on Java, while Java is a strongly typed language, so we have to declare a variable of type, and in place of manual conversion type requires. This makes JSP become a scripting language for programmers to learn.

PHPWork with Java

JSP is just a kind of access to the Java object language only, it is important to recognize the. PHP can also integrate Java, this means that PHP can, like JSP, can become a scripting language called Java logic. But unlike JSP, PHP also can call other component models, such as Microsoft COM, and the increase of the new object model support is also very easy. Visible, extend the power of PHP is infinite. On the other hand, JSP is completely dependent on Java.

IBM programmer Sam Ruby combined with PHP and Java. Through the PHP good support for Java, the Java object as the conventional PHP objects are created and used, transparent.

The AutionWatch website makes all sizes of commercial groups can benefit from the dynamic competitive environment. The number of visitors to its monthly in two million six hundred thousand above; has about three hundred thousand registered users; a one million two hundred thousand auction every month. They have tried to use Java, but still chose PHP, because it is easier to use, faster development. If you want to know more, please contact Ben Margolin, he is the director of the AuctionWatch website sales service department().

Programming consultant Reuven Lerner worked in various languages for comparison. He thought of PHP as follows:

“This is an easy language to learn. Artists and Web designers may say they are not programmers, But in fact, They are in large projects, The increasing use of JavaScript, VBScript and some other simple programming language. Compared with Perl, PHP is more formal and clear; for a novice, PHP master more easily than Java. Exactly, PHP is a bit like the JavaScript (if the server version exists). Any person, No matter there is no programming experience, Can be learned in a short time and the use of PHP. This may VBScript can do, But not... Perl and Java sure..PHP is an absolutely extraordinary, The powerful system. It is no wonder that can become a popular language... To create a Web site.. I think, PHP Java and JSP will become strong competitors, I would strongly recommend PHP in internal project customer and company. ”

PHP: Has been in progress

JSP Sun as its backing., Therefore we gained media attention. But it is interesting, Despite the absence of any campaign, PHP's popularity is still at a rate of 8-11% growth, Much larger than the server application 4% monthly growth rate. There are six million five hundred thousand sites using PHP (see Netcraft 2001 report on May). 39% Apache server configured PHP; while Perl accounted for 11% of the market share, Ranked fourth. Apache retains the Web server 59% market share; the time of the Microsoft, Only 28% (see the E-Soft Inc./SecuritySpace survey in 2001 May).

The use of PHP famous companies are: Unilever, Philips, NTT, Cisco, Japan Airlines, Air Canada, Lufthansa, GE Marketplace, Wallstreet:Online Germany, AuctionWatch, VillageVoic, Dialpad and BMC.

1.Intranet Design magazine: a IT manager to view on PHP, June 4, 2000.

2.eWEEK: Speed the development of fourth script language, October 30, 2000.

About PHP's future (three)

A brief history of 6.PHP

PHP started as a simple Perl written using CGI tool, called “ personal homepage (Personal Home Page Tools tool), later renamed the ” “ personal home page construction kit(Personal Home Page Construction Kit)”.

Also called “ professional tools (Professional Home Pages) home page, ” now the latest name is

“PHP: hypertext preprocessor(PHP Hypertext Pre-Processor)”

There is also a tool, can be very simple to SQL query into Web page. This tool is basically can be regarded as the analysis of SQL query statements, another CGI tool to create forms and form very easily and on the basis of the. This tool called FI (Form Interpreter, form the interpreter).

PHP/FI2.0 completely rewrite the two packages, and merged into a single program. Eventually develop into a block in the HTML file of the simple programming language. PHP through placed directly in the HTML file simple script

Eliminates the need to create a large number of tiny Perl CGI program. Because from the multiple calls to Perl program load, so greatly improve the overall performance of your Web page. Greatly improve the overall performance of your Web page. And through the Web page of all the components in a separate HTML file, so that a large site management easier. Due to include for various database support, development can be very easy to database based on Web page. Many people think that, in this way than to create separate HTML and CGI files more simple.

Now, PHP/FI has been renamed to PHP.

7 a simple example

If you have such a form:


<INPUT TYPE="text" name="name">

<INPUT TYPE="text" name="age">

<INPUT TYPE="submit">


Your display.html file can be displayed to submit the form content:

<? echo "HI $name, you are $age years old!<p>"; ?>

This is so easy! PHP automatically for each form input domain creates a variable. You can directly in the

These variables are used in the ACTION points to a file.

Once it's clear the variable usage, so the next step you can write some logic process in the page. For example, you want to display a different message according to the user input is different, you can use a if/else statement. The above example is changed, we can do different shows based on user input age:



  echo "Hi $name, you are ancient!<p>";


  echo "Hi $name, you are very old!<p>";


  echo "Hi $name.";



PHP provides a very powerful scripting language, it can do more than the above simple examples of multi. See the PHP script language, get more information.

You can also use PHP to configure the page access. This is done through a built-in configuration interface to achieve. For example, you can specify from a specific domain users can access your page. Or, you can also create a rule, the protection of a specific page with a password. See the access control section, in order to obtain the detailed content.

PHP also can be compatible with the RFC-1867 from any Web browser to upload files. This allows users to upload the text and binary files. Through the access control and logic function of PHP, you can upload files and upload files after the implementation of what operation to achieve complete control over who can. See the file upload, in order to obtain the detailed content.

PHP PostgreSQL database support package. It supports embedded in a HTML file of SQL query statements.

8 SOAPX4 and PhpXMLP

SOAP is a protocol based on XML, used in the two inter process messages and RPC communication. The World Wide Web Consortium XML protocol (XP) working group is developing the SOAP standard, this standard will be called XP.

SOAPX4(Simple Object Access Protocol, Simple Object Access Protocol) is a PHP implementation:


8.1 XML/XSLT publishing engine

Krysalis is a set of publishing engine PHP technology based on XML/XSLT, the design idea comes from Cocoon.

InterAKT development of Krysalis is to achieve the next generation of Web services, namely information, application logic and expressed complete separation layer.

Krysalis is an open source XML/XSLT based PHP development platform, which utilizes the most of PHAkt code, create a Krysalis tag library(taglib).

Its main function has:

·Dynamic XML support.

·Dynamically generated PDF document.

·The description of the site map with regular expression.

·PXP page cache.

·Multiple conversion pipeline.

·For multiple connections to different types of data(ADODB).

Please visit the Krysalis website for more information

The 9.PHP class library

PHP is an object-oriented scripting language. Therefore, the PHP code is “ class, Class, Class, Or ”. When you write PHP code, You must write reusable classes, These classes can use the existing class. The Internet has a lot of writing good class, It can be used. Which is used to access the database class, Generate XML documents and HTML form class, There are also used to create tables and other HTML object class. If you write what general class, Would you please put it on the Internet. By 2005, The Internet will be more than 100000000 reusable PHP class. PHP's advantage is that they provide data hiding, inheritance, encapsulation, reliability, reusability and polymorphic functions and properties. Here are the most important PHP site:

9.1 PHP class and the PHP extension and Application Repository

Can visit the following Web site a lot can immediately use the PHP Library

·PHP classes:

·PEAR(The PHP extension and Application Repository) is a PHP extension program code base, similar to the Perl CPAN:

·ADODB (Active Data Objects Data Base, The dynamic data object database): database access function of PHP is not uniform. The API function of each database extension uses different and incompatible. The need to create a database to hide the differences between different databases (i.e. the encapsulation of the differences between different databases). Thus, We can realize the database easily switch. ADODB currently supports MySQL, PostgreSQL, Interbase, Oracle, MS, SQL 7, Foxpro, Access, ADO, Sybase and ODBC. Can refer to the ADODB manual. PhpLens is based on the ADODB.

·Metabase (Independent access and management database)

·PHP Hot scripts:

·The popular PHP resource site:

·The PHP project site:

·PHP Lib Netuse:

·The PHP gadget:

·PHP4 framework:

·Source Forge PHP Library:

·Source Forge PHP program fragment:

·E-gineer PHP Library

·Answers to common problems of PHP:

·The PHP Library

·PHP factory:

·PHP Builder:

·PHP developer:   

·PHP novice:

· PHP walrus:

9.2 other PHP tools

Other PHP tools:

·User login samples:

·PhpPDFtable is a PHP class, create a convenient PDF statements. The need to install PHP4.x (PHP3.x should be) and PDFlib:

·The data administrator provides a data management interface based on PHP. It is not limited to one or two database. And the package of the original PHP database access function:

· PSlib is a used to generate PostScript document library. Provides an easy method for generating PostScript files. Only in your PHP script calls the PSlib function can be very easy to generate the PS file:

· Be closely PHP script to a complete set of, can create highly customized, dynamic and module for the web site:

·PhpOpenTracker is a comprehensive solution for a site access track. The collected data is stored in the SQL database. Can be complex but simple analysis. One set for the analysis and generate reports containing (HTML and PDF) of the powerful API:

·PHPShopCart is a PHP to write online shopping cart program, the use of MySQL database. This procedure is “ Linux database under the guide of ” this book written”(Syngress Media):

10 PHPGem package

PHPGem is a PHP script, Can accelerate the formation of operation data in table PHP scripts. It can work in different SQL database, Such as PostgreSQL, MySQL, mSQL, ODBC and Adabas. As long as you input the information and data fields (such as field names, yes / no search fields), PHPGem will provide you another PHP script output, The script can perform various operations on the data sheet (Browse / add / edit / delete / copy / search). PHPGem supports multiple nested tables. PHPGem allows you to specify for each data table and field access level for each user. Image information is also supported by PHPGem.

Experts predict: PHP will be better than the Java is more popular

Netscape co-founder Marc Andreessen at the Zend/PHP meeting that PHP simple, descriptive language of writing tools, in the development of Web-based applications, will be more popular than Java.

In the sun (Sun Microsystems) after Java published in 1995, the friendly interface of Java allows the engineer to design software easier for engineers, is welcome, but ten years down the Java continued to be added to the powerful function, but it is not easy to operate. Marc Andreessen points out, the Java may be more difficult to learn, than C++ at the same time, PHP inherits the spirit of simple Java, and create a more easily than the use of Java programming environment.

PHP is an open source project, including descriptive language engine can simplify the procedure and a large library, also have specially developed PHP companies, such as Zend have sales of PHP product suite, programming tools and technical support services.

Andreessen's view may be very difficult to win the Java champion identity, because at this stage there are still millions of studying global Java engineers, there are hundreds of companies involved in the Java Community Process (JCP), common in JCP took Java's fate. But, even if is strongly support the Java, even with Java as the core of the IBM WebSphere server software, also think that PHP's future will be better than Java.

The new IBM network technology division vice president Rod Smith said, "simple" is the biggest characteristic of PHP, and it is not in competition with other language with new language features, Java is clearly not to do so.

Moreover, PHP strength is not small, there are about 22000000 of the site using PHP, including Yahoo!, Lufthansa and other famous sites, and the number is increasing, any changes and has 450 software engineers have the right to audit in PHP software.

Compared with Java, PHP available category more restricted, it can only be used in a network server, unlike Java, also available on a network server, a personal computer, mobile phone, chip card or other device.

Java and PHP in addition to competing in some respects mutually, to see a certain degree, also in each other by long. Oracle product strategy vice president Ken Jacobs said, even if the Oracle (Oracle) Java server sales at the same time the executable Java and PHP with the database software, but it is Java plus an additional new features, so that the two software projects can be coordinated operation; more specifically, the Java specification (JSR 223) 223 will help to build the bridge between the Java community and the PHP community」.

Recently published can share photos and other content website "Ning" Marc Andreessen also said, now also Ning Java and PHP, of which the core system is composed of Java, compared to the station all visible applications are written in PHP, Java is more like operating system level.

Like other such as Linux and Apache open source project, PHP is also the main Dachang industrial computer protection, like IBM and Oracle are committed to the development of PHP software can capture its database program. In fact, IBM and Oracle act like in PHP endorsement, the two companies will support PHP, that PHP might be a good stuff.

Before the collection of data now take out and share with you.

Sea breeze garden -- a comparison of serious PHP platform

The wind wave to share so many, later will continue to share our gadgets to everyone. Share technology long live, forever.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Avivi at October 23, 2013 - 9:44 PM