PHP Development of large Web applications (1) _php tutorial

Source: Internet
Author: User
The "big" application here is not to say, like Google, EBay, Yahoo, such as the specific implementation of large sites, I do not intend to persuade the reader to abandon their concepts and beliefs, just hope that everyone's system can run faster and smoother, can carry more users online, Hope you can give PHP a little help for beginners.

With regard to the efficiency of PHP execution, there are a lot of special articles on the Internet, many of them start with the controversy of PHP and Java, and end with an uncertain expectation, and seldom see a definite conclusion. Indeed, the efficiency of execution of programs is difficult to derive from comparisons. The different aspects of application, the different execution environment, the difference of efficiency will be very poor. And efficiency is also need to weigh, we all know that assembly language is very low, you can write very efficient procedures, but I have very little, should be said to have been almost no one to do web development with the Assembly, and the ability to write high-efficiency programs compiled by people seem to be worth looking up, haha ~ We do not need to discuss how much PHP and the compilation is poor, as long as you know their PHP and other people's PHP difference is possible.

First, make clear the premise of this article: there must be one or more servers that can be manipulated by themselves, not virtual host space. After all, the general system can be run on the virtual host has a lot of classic works and mature framework, efficiency mining has been done by predecessors very good, many of their ideas are now many PHP users inherit and develop, more and more so-called "frame" also like the stars, I do not want to write that, Because the first my own level is not good, write nothing new, write to also smile, the second is to write this article too much, too much, confusion is to cause many passionate future genius programmer die the biggest culprit.

Programs that are executed on a stand-alone server and programs that can be run on a virtual host vary greatly in efficiency optimization. You can certainly install a set of Discuz on a single, even a bunch of standalone servers, but does it really get the maximum performance optimizations you really deserve for this heap of servers?

A stand-alone server means that the user has complete control over the machine, including installing, removing software, configuring system parameters, and even modifying the source code. Based on such an open hardware platform, performance is not only reflected in the speed, but also includes security, stability and so on. Unlike virtual hosts, users have to configure their own Web server parameters, install and configure PHP, database, and install a variety of miscellaneous things (I like to say) and, of course, take responsibility for them.

First, several nouns are proposed: execution time, template, database encapsulation, Cache, Buffer, Hash, Daemon, crontab.

Execution time, which everyone knows, is the time it takes for a program to start from execution to completion. Because the web is instantaneous and stateless, execution time is an indicator of the efficiency of a Web program's execution, and it is not appropriate to measure C/s programs or Daemon daemons, because many of them are constantly running. A typical example of page execution time is the discuz at the bottom of the forum page, usually discuz from milliseconds to dozens of milliseconds, and the platform used, the amount of data, and the current system pressure.

We are familiar with the template, although a lot of people just use, but do not know why the use. The template is traditionally a way of dividing the logic layer, in the MVC structure, it separates the presentation and the lower layer, in practical use, it is convenient for programmers and interface designers to work together. However, on many occasions, because of improper use of the template, it has not been to promote the programmer and Interface designers division of labor, but instead of the programmer and the art of mutual hatred of the culprit (as I said in a previous post), many people complain that they have to spend a lot of time to organize the template.

Database encapsulation seems to be more related to Java, which provides a unified calling interface to a variety of database systems, usually packaged classes that sometimes perform tasks such as SQL checking, filtering, and so on. Phplib in the DB package, PEAR db, ADODB, etc. are very famous, with a lot of people. 1

http://www.bkjia.com/PHPjc/446673.html www.bkjia.com true http://www.bkjia.com/PHPjc/446673.html techarticle The "Big" application here is not to say, like Google, EBay, Yahoo, such as the specific implementation of large sites, I do not intend to persuade the reader to abandon their own concepts and beliefs, but I hope you ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.