PHP related concepts and simple configuration

Source: Internet
Author: User
Tags apc php language pear php server php framework php source code
<span id="Label3"></p><p><p><br></p></p><p><p>Activex:windows is a technique that executes programs on the client side of a technology Above.</p></p><p><p><br></p></p><p><p>Jvm:java virtual machine, Virtual a Java running sandbox, which can load Java required classes, etc.;</p></p><p><p><br></p></p><p><p>Java is known as a compile-time, run-everywhere Program. But running around is a prerequisite, which is to have a jvm.</p></p><p><p><br></p></p><p><p><br></p></p><p><p>Cgi:</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Protocol</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>The web process can invoke different program execution environments depending on the corresponding Program.</p></p><p><p></p></p><p><p>webapp:java,c,c++, etc.;</p></p><p><p><br></p></p><p><p>Programming Languages:</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Static language (compiled Language)</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>C,c++,java</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Strong type, which needs to be compiled before it can be Run.</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Advantages: Good performance</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Cons: every change needs to be recompiled; therefore, c,c++ is especially suitable for low-end programs. Can operate the hardware,</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span><span class="Apple-tab-span" style="white-space:pre;"></span> But their many functions need to be developed by the user Themselves. Great development and Maintenance Costs.</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span><span class="Apple-tab-span" style="white-space:pre;"></span></p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Dynamic Language: interpreted language</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>shell,perl,python,php</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Weak type, do not need to compile, only need to have a dynamic interpreter.</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Advantages: Easy maintenance, There are many shared modules, short development cycle, Low maintenance Costs.</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Disadvantage: Poor performance;</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span></p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span></p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Web Server Site:</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Perl</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Python</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Java (jsp,ssh (spring,structs,hibernate)</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span></p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Ruby,rails</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Php: No other framework is needed to develop Web server Sites.</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span></p></p><p><p>Facebook:</p></p><p><p>Dynamic language development Program----through a translator-to-static language;</p></p><p><p>Such as: php-->hiphop->c++ procedure;</p></p><p><p></p></p><p><p></p></p><p><p></p></p><p><p>Programmers Form Discipline:</p></p><p><p>Basic syntax</p></p><p><p>algorithms, Data Structures</p></p><p><p>Compilation principle</p></p><p><p></p></p><p><p></p></p><p><p>Openstack: all developed using python;</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span>Do what you are better at;</p></p><p><p>Do what you do best in the way you do it.</p></p><p><p><br></p></p><p><p>Bash: the process of troubleshooting;</p></p><p><p>Lexical analysis---syntax analysis--generate Execution path;</p></p><p><p>Parser is an analyzer;</p></p><p><p></p></p><p><p></p></p><p><p></p></p><p><p>Php:</p></p><p><p>Interpreter's work: PHP</p></p><p><p>PHP source code--compiled into binary format--execute;</p></p><p><p>About PHP</p></p><p><p><br></p></p><p><p>I. Introduction of PHP</p></p><p><p><span class="Apple-tab-span" style="white-space:pre;"></span></p></p><p><p>PHP is a generic server-side scripting language, which is used primarily for web development to implement Dynamic Web pages, and is one of the first Server-side scripting languages to implement scripts embedded in HTML source Documents. PHP also provides a command-line interface, so it can also be used as a standalone shell on most systems.</p></p><p><p><br></p></p><p><p>Rasmus Lerdorf began developing PHP in 1994 as a group of Perl scripts that were Rasmus Lerdorf called the "Personal Home Page Tool".</p></p><p><p>These scripts can be used to display the Author's CV and to record user access to their Website. later, Rasmus Lerdorf used the C language to rewrite these Perl scripts as CGI programs,</p></p><p><p>It also adds the ability to run Web forms and the features that interact with the Database.</p></p><p><p>and rename it to "Personal Home page/forms interpreter" or "php/fi". At this point, php/fi can already be used to develop a simple dynamic web program,</p></p><p><p>This is PHP 1.0. In June 1995, Rasmus Lerdorf posted its php in the comp.infosystems.www.authoring.cgi Usenet discussion group,</p></p><p><p>Since then PHP began to enter into People's Horizons. In 1997, its version 2.0 was Released.</p></p><p><p><br></p></p><p><p>In 1997, two Israeli programmers Zeev Suraski and Andi Gutmans rewritten Php's parser (parser) as the basis for Php's development to 3.0, and since then renamed PHP to Php:</p></p><p><p>Hypertext Preprocessor (hyper-text preprocessor). Since then, the two programmers began rewriting the entire PHP core, and in 1999 released the Zend Engine 1.0, which also means the birth of PHP 4.0.</p></p><p><p>In July 2004, Zend Engine 2.0 was released, which also brought PHP into the PHP5 Era. PHP5 contains a number of important new features, such as enhanced object-oriented programming support,</p></p><p><p>Supports the PDO (php Data Objects) extension mechanism and a series of improvements to PHP Performance.</p></p><p><p><br></p></p><p><p>second, PHP Zend engine (engines, engines)</p></p><p><p><br></p></p><p><p>Zend engine is an open source, PHP scripting language interpreter, originally developed by the Israeli polytechnic (Technion) student Andi Gutmans and Zeev suraski,</p></p><p><p>Zend is also the name of this two people collectively. later, The two men jointly founded the Zend Technologies COMPANY.</p></p><p><p><br></p></p><p><p>Zend Engine 1.0 was released in 1999 with PHP 4, developed by the C language and highly optimized and can be used as a backend module for PHP. Zend Engine provides PHP with a</p></p><p><p>The features of memory and resource management, as well as other standard services, have played an important role in promoting PHP as a popular language, with its high performance, reliability, and Scalability.</p></p><p><p><br></p></p><p><p>The advent of the Zend engine divides the process of PHP code into two stages: first, parsing the PHP code and converting it into a binary format called Zend opcode (similar to Java</p></p><p><p>Byte Code) and store it in memory, and the second stage is to use Zend Engine to perform these converted Opcode.</p></p><p><p><br></p></p><p><p>third, Php's opcode</p></p><p><p><br></p></p><p><p>OpCode is a php script-compiled intermediate language, like Java's bytecode, Or. NET of Msl. PHP executes PHP script code generally through the following 4 steps (to be exact,</p></p><p><p>It should be Php's language engine zend):</p></p><p><p>1, scanning (lexing)--convert The PHP code to a language fragment (Tokens)</p></p><p><p>2. Parsing--converts tokens into simple and meaningful expressions</p></p><p><p>3. Compilation--compiles the expression into Opocdes. note: The opcode is placed in memory.</p></p><p><p>4, execution--sequential Execution of opcodes, one at a time, thus realizing the function of PHP script</p></p><p><p><br></p></p><p><p>Iv. PHP Accelerator (phpopcode cache)</p></p><p><p><br></p></p><p><p>Special php-based extension mechanisms such as opcode cache extensions can also cache opcode in Php's shared memory, allowing for subsequent duplication of the same piece of code to skip the compilation phase to</p></p><p><p>Improve Performance. It can also be seen that these accelerators do not really improve the speed of the opcode, but only by analyzing the opcode and rearranging them to achieve the purpose of fast Execution.</p></p><p><p><br></p></p><p><p>The Common PHP accelerators are:</p></p><p><p><br></p></p><p><p>1. APC (alternative PHP Cache)</p></p><p><p>Following PHP License's open source framework, php opcode cache accelerator, The current version is not available for PHP 5.4. Project address, http://pecl.php.net/package/APC.</p></p><p><p><br></p></p><p><p>2, Eaccelerator</p></p><p><p>Originating from Turck mmcache, the earlier version included a PHP encoder and PHP loader, and currently encoder is not supported. Project address, http://eaccelerator.net/.</p></p><p><p><br></p></p><p><p>3, XCache</p></p><p><p>Fast and stable PHP opcode cache, rigorously tested and heavily used in production Environments. Project address, http://xcache.lighttpd.net/</p></p><p><p><br></p></p><p><p>4, Zend Optimizer and Zend Guard Loader (Zend optimizer)</p></p><p><p>Zend Optimizer is not a opcode accelerator, it is a free, closed-source PHP extension provided by Zend Technologies for PHP5.2 and previous versions,</p></p><p><p>It is capable of running encrypted PHP code or fuzzy code generated by Zend Guard.</p></p><p><p>The Zend Guard loader, however, is an extension that is designed for PHP5.3 similar to Zend Optimizer Functionality.</p></p><p><p>Project address, Http://www.zend.com/en/products/guard/runtime-decoders</p></p><p><p><br></p></p><p><p>5, Nusphere phpexpress</p></p><p><p>Nusphere's Open source PHP accelerator, which supports loading PHP program files encoded by Nusphere PHP encoder, and enables faster execution of regular PHP Files. Project address, http://www.nusphere.com/products/phpexpress.htm</p></p><p><p><br></p></p><p><p><br></p></p><p><p>Www.php.net:php's Official Site address;</p></p><p><p><br></p></p><p><p>five, PHP Source directory structure</p></p><p><p><br></p></p><p><p>Php's source code is structurally clear. Its code root contains a number of documentation and design scenarios, and provides the following subdirectories:</p></p><p><p><br></p></p><p><p>1, Build--as The name implies, here are mainly to put some source code compilation related files, such as the beginning of the construction of the buildconf script and some check the environment of the Script.</p></p><p><p>2, ext--official extension directory, including the vast majority of PHP functions of the definition and implementation, such as the array series, PDO series, SPL series, such as the implementation of Functions. Personal development extensions can also be placed in this directory when testing, to facilitate testing and so On.</p></p><p><p>3, Main--here is the most core PHP file, is to implement PHP infrastructure, here and Zend Engine is not the same, Zend engine mainly to achieve the language of the most core language operating Environment.</p></p><p><p>4, Zend--zend engine implementation directory, such as script lexical parsing, opcode implementation and extension mechanism implementation and so On.</p></p><p><p>5, pear--php extension and application warehouse, including Pear core Files.</p></p><p><p>6, Sapi--contains The various server abstraction layer code, such as Apache mod_php,cgi,fastcgi and FPM and so on Interface.</p></p><p><p>7, tsrm--php thread safety is built on the TSRM library, PHP implementation Common *G macros are usually TSRM encapsulation, tsrm (thread safe Resource manager) Thread safety resource Manager.</p></p><p><p>8, tests--php test Script collection, contains PHP various functions of the test Files.</p></p><p><p>9, Win32--this directory mainly includes some Windows platform related implementations, such as SOKCET implementation under Windows and the *nix platform is not the same, but also includes the Windows compiled php-related scripts.</p></p><p><p><br></p></p><p><p><br></p></p><p><p>The question is how does Php's compilation result come together with our Apache server?</p></p><p><p><br></p></p><p><p>Cgi:common GATEWAY INTERFACE</p></p><p><p>How does the Apache process and the PHP interpreter establish an association relationship???</p></p><p><p></p></p><p><p>Scriptsalias view its location and access it.</p></p><p><p></p></p><p><p><br></p></p><p><p>What is mvc?</p></p><p><p>Model View Control: modules, views, controls. A software design Concept.</p></p><p><p>A programming technique that separates business logic from data display. You only need to put the H1 tag in a separate file, and the current script only processes the Data.</p></p><p><p><br></p></p><p><p>Embedded Web Development language:</p></p><p><p>index.php language, How to write, how to Write.</p></p><p><p>

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.