Current location - Education and Training Encyclopedia - Educational institution - What are the advantages of php live source code development?
What are the advantages of php live source code development?
PHP (Hypertext Preprocessor) is a universal open source scripting language. Its grammar absorbs the advantages of C language, Java and Perl, which is free, fast and efficient, and is mainly suitable for the field of Web development.

At present, more than 60% of the 50 million Internet websites in the world are using PHP technology. There are 394 websites in AlexaTOP500 ranking in China that use PHP, and more than 80% dynamic websites in China use PHP for development. In the web back-end language, PHP has a global market share of 80%.

People like Facebook, Google, Sina, Baidu, YouTube and Tencent are all using PHP.

Eight advantages of PHP language:

1, open source code, all PHP source code can actually be obtained.

2, free, php Compared with other technologies, PHP itself is free and open source code.

3, fast, fast program development, fast operation, and fast learning of technology itself. Embedding HTML: Because PHP can embed HTML language, compared with other languages. The editing is simple and practical, which is more suitable for beginners.

4. Strong cross-platform, because PHP is a script running on the server side, which can run under UNIX, LINUX, WINDOWS and Mac OS.

5, professional focus, PHP supports scripting languages, both of which are C-like languages.

6. Efficient PHP consumes very little system resources.

7. Object-oriented. In php 4 and php 5, the object-oriented aspect has been greatly improved, and large-scale commercial programs can be developed with PHP.

8, image processing, using PHP to dynamically create images, PHP image processing uses GD2 by default. It can also be configured to use image magick for image processing.

Three common running modes of PHP: CGI, FastCGI and APACHE2HANDLER.

1、CGI

CGI is a public gatewag interface, which is a program. Generally speaking, CGI is like a bridge, connecting the WEB page and the execution program in the web server. It passes the instructions received by HTML to the server's executive program, and then returns the results of the server's executive program to the HTML page. CGI has excellent cross-platform performance and can be implemented on almost any operating system.

2、FastCGI

Fast-cgi is an upgraded version of cgi. FastCGI is like a long-lived CGI that can be executed all the time. As long as it is activated, you don't have to spend time forking every time. PHP is managed by PHP-FPM(FastCGI process manager).

But every Web request PHP must reparse php.ini, reload all extensions and reinitialize all data structures. With FastCGI, all this happens only once at the beginning of the process. An added benefit is that persistent database connections can work.

3. Apache 2 handler

PHP is an Apache module. After the system is started, Apache server will generate multiple copies of the process in advance and store them in memory. Once there is a request, it will immediately use these standby subprocesses for processing, so there will be no delay caused by the production subprocesses. These server copies don't quit immediately after processing an HTTP request, but stay in the computer and wait for the next request. The response to client browser requests is faster and the performance is higher.

How to protect your PHP code:

1, code obfuscation+encryption

It is to encrypt the code base64, then map the string in base64 (randomly generate dictionary confusion), and then eval will restore this 100% crack.

2. Confuse the garbled code

There is something similar to the principle of 1 in code confusion variables, but it is only a matter of time before the string is changed to characters between ascii 127 and 255, which is incomprehensible to non-human and editors.

3. Issue the operation code

Don't distribute the code, precompile the PHP code first and distribute the operation code. After PHP7, opcache deeply integrated this thing. After PHP7, you can use this method to protect the source code, but it will also be decompiled and cracked by the operation code.

4. Chaos+encryption+writing PHP extensions

Confusion+encryption+writing PHP extensions, but as long as it is an open source PHP extension, it will be cracked unless you write your own encryption algorithm, encrypt PHP code, and then write the extension in C voice. Others don't know your encryption ideas and cracking ideas, and the possibility of being cracked is very small.