PHP Knowledge Prerequisites

Source: Internet
Author: User
Tags apc yii
The most popular PHP MVC framework
http://yp.oss.org.cn/software/show_resource.php?resource_id=742
Yii (sound easy frame, I generally directly read yii) codeigniter (Jane read ci) Symfony CakePHP

MVC, this look at Baidu on line, MVC in the Computer World general
Http://baike.baidu.com/view/31.htm

How to improve PHP running speed
Http://www.php100.com/html/webkaifa/PHP/PHPyingyong/2012/0105/9616.html
Zend Optimizer is mentioned here, which is generally not very good.
Zend Cache, APC, and Afterburner caches, which are commonly used by APC, are often used to cache the include require (these are automatic when the APC function is turned on, That is, after PHP runs to require will not read the hard disk, but read the cache)
Compressed Web content, refers to the content of the Web site, the output of a lot of HTML code, open gzip reduce network traffic
Code-level, code reuse, the use of internal functions, the algorithm is better, logical simplification, can be a certain degree of acceleration

To improve the speed, the essence of finding a functional block of performance bottlenecks, to do special optimization of the problem.
For example, if MySQL read a large amount, according to the use of frequent cache, avoid multiple requests MySQL, share the pressure. The cache can use the local file cache, can use Memcache Redis and some NoSQL databases (NoSQL databases are generally key-value databases)
There are some very time-consuming processing, you can consider whether it can be pre-processing, by scheduling tasks scheduled to save up, use the direct call, instead of the current calculation.
There are some time-consuming, but this request is not directly concerned about the results, you can consider asynchronous processing, such as throwing it to the [message queue], another program to perform related operations, so that the current program can quickly return results.
All high-concurrency site architectures are distributed, that is, a request may be shared by a good number of machines, Web server distribution, database distribution, storage distribution.

Site distribution, in order to increase the speed of user access in different regions, will be the site host to a variety of computer room, telecommunications, Unicom, CRC, Mobile, overseas and other computer room. When accessed according to the source assigned to the appropriate server, generally the same network of servers are randomly allocated, using a load balancer to do the scheduling, you can also use DNS round-robin method of random allocation. Ask you the implementation details such as load balancing can not be known, the mention of these words can be, there is hardware dedicated to do, you can also use the program to simulate the implementation. Program implementation is nothing more than writing an algorithm to randomly assign. The DNS round robin is done at the DNS resolution layer, and these are operations and maintenance things.

Site distribution, resource requests are internal, within the computer room through the server to achieve high-speed access, which is the network operation and maintenance of things. The simple approach is to use two or more lines on the server, that is, a server has telecommunications IP also has netcom IP, so different network over, request different IP address, to achieve higher speed access.

Database distribution, MySQL provides master-slave (Master-slave) way, that is, the database has a master server, can have many from the server, slave sync data from master, Web server requests from slave to query, reduce the master pressure. It is also possible to split the data into different servers by segmenting data, which also reduces the pressure on the data requests (but also accesses multiple database servers and adds some overhead). MySQL's master-slave synchronization principle is Binlog, through the synchronization of the master server Operation command process, to achieve on the server to rebuild data. At the same time, this mode also realizes the reading and writing separation, writes the time to write on the master, reads the time to read on the slave. Prevents write speed from affecting read speed when large concurrency occurs

Storage distribution, some resources can not be placed on the main site, such as JS CSS pictures, can be placed on other machines, we often find some big website pictures, may be img1 img2 img3 static pic and other domain names at the beginning of these are the practice of separating this resource. At the same time, these static resources can be used to speed up the CDN (the full name of the CDN is the content Delivery network, i.e. the contents distribution networks), the CDN server can be built on its own, or can purchase third-party services


Versioning, from CVS to SVN and git, is typically svn,cvs early, and is now being replaced by SVN, a new generation of Git is now on the rise.
The role of code versioning software is to save the code on the server, update, submit two operations, to achieve the final revision of the code, so that many people cooperate easily. When the release of the version, a tag, the code is fixed at that moment. You can continue to develop yours without interfering with that tag. You can also open multiple branches, so that different people can develop a variety of versions, can be 1.0 2.0 and other versions of the simultaneous development, non-impact. The development is finished, you can also merge versions.
Another benefit of using versioning is that the code is on the server, and even if the machine is broken, it will not affect the results of your work. If someone mistakenly action, the code is destroyed, you can also roll back.
About these three versions of the management software use method, own Baidu


HTTP protocol
Http://www.blogjava.net/zjusuyong/articles/304788.html
Focus on the status code, 200 304 403 404 500 502, where 304 is the server set a static file expiration time, within the validity period, the browser to the server side returned 304 status, no longer transfer files from the server, and use the browser cache. This article has time to read, which is the foundation of the entire Web request. Much of the essence of optimization revolves around this protocol. Including cookies is an integral part of the HTTP protocol.

Two common ways to keep conversations the difference between a cookie session
Http://www.cnblogs.com/shiyangxt/archive/2008/10/07/1305506.html

GET post two types of HTTP request differences
Http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html

Both JSON and XML data formats
Http://wenku.baidu.com/view/49800b83d4d8d15abe234e83.html
These two data formats, usually the return format for third-party request data, or the format in which the server returns data to the front end. Your own projects are more used in AJAX requests to return.

About Ajax
http://www.w3school.com.cn/ajax/
AJAX = asynchronous JavaScript and XML. You can also use JSON instead of XML.

Then there are several frameworks that involve JavaScript
Http://www.blogjava.net/kent/articles/202855.html
The mainstream uses jQuery, which is generally used because it's easy to use and easy to understand.
jquery Tutorial http://www.w3school.com.cn/jquery/


Linux Common commands
CD ls CP rm mkdir ssh rsync WCP sudo
The specific order may not be in the exam, but will certainly ask you will not use Linux, because 90% of Internet companies Web projects using Linux or UNIX as a server, not Windows

MySQL's several storage (table) engines
Http://database.51cto.com/art/201105/259232.htm
Mainstream use MyISAM InnoDB
InnoDB and MyISAM differences
Http://wenku.baidu.com/view/2630add5b9f3f90f76c61b35.html


NoSQL Database
Http://www.infoq.com/cn/news/2011/01/nosql-why
http://robbin.iteye.com/blog/524977
Redis,tokyo Cabinet,mongodb

Memcache is also a NoSQL database, but it's not a persistent store, it's just in-memory cache
Http://www.cnblogs.com/qiantuwuliang/archive/2011/03/07/1974499.html
The use of Memcache

Comparison and analysis of three Web servers Apache lighttpd nginx
Http://wenku.baidu.com/view/96095c1f227916888486d7d2.html

Several tools for full-text search
Coreseek Sphinx Lucene


Three ways to run PHP
http://blog.csdn.net/anljf/article/details/7086034
Apache module way CGI mode fastcgi way

42 optimization Criteria that should be noted by the PHP development program
Http://www.php100.com/html/webkaifa/PHP/PHPyingyong/2012/0105/9617.html

  • 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.