Home Backend Development PHP Tutorial PHP version selection 5.2.17 5.3.27 5.3.28 5.4 5.5 Compatibility Issue Analysis_php Digest

PHP version selection 5.2.17 5.3.27 5.3.28 5.4 5.5 Compatibility Issue Analysis_php Digest

May 16, 2016 pm 07:54 PM
php version

Edited by: Maizi

Everyone must be confused when choosing a PHP version. There are so many versions, which one should you choose?

Question:

We have now bought a new server, using Windows Server 2008 r2. Configure the php 5.4 environment.
But we used 2003 and PHP version 5.2 before we developed it. If we transplant it to the new server, will there be any impact on the running of the program? Or are there other issues I need to pay attention to?
API version

PHP adopts a backward-compatible upgrade method for major versions, which means that 5.5 is compatible with 5.1-5.4. Having said that, the compatibility is actually not optimistic, and you should not expect any good solutions from the PHP official. Now in September 2013, the versions are 5.2.17 5.3.27 5.4.17 5.5.3

5.2.17
This version can be said to be the most widely supported version. Most open source software now uses this version, such as Drupal7.23, Joomla2.5, and most domestic software: dedecms5.7, discuzX3, etc. The latest version is still available. In support of 5.2, if there are no special requirements, installing this version is the most trouble-free and labor-saving, but it may eventually be abandoned in the long run. Nowadays, many hosting companies are too lazy to upgrade the PHP version in order to save labor costs, and basically support it anyway. (Insert a word here. In order to be compatible with more installation environments, domestic software is now very well-intentioned. Even PHP5.1 can support it (discuzX3 does not support it). The most rare thing is that the performance is not far behind, and it can do this. It’s really not easy!) Drupal6 is recommended to use this version.

5.3.28 (recommended)
Although the name of this version starts with 5, many people think it is the beginning of PHP 6.0 version. The performance has been improved, and because many APIs have changed, the compatibility with 5.2 is not very good. Although some open source software claims to be able to It is compatible with 5.2-5.3, but there seems to be a lot of problems, and many simply give up on 5.2. For example, Joomla3 only supports 5.3 and above. For Drupal7, it is strongly recommended to use this version, the support is quite good. This version can also be used for Drupal8, and the support is quite good. This version is widely used and strikes a good balance between performance and compatibility.

5.4 (gently recommended)
5.4 is basically close to complete. It is relatively complete at present, and its stability and performance are also good. Drupal7. If you are too lazy to upgrade later, you can install this version in one step.

5.5
Starting from 5.3, future versions will basically focus on performance improvements, and functions and other functions will be backward compatible. Starting from 5.5, there seems to be a 64-bit version with more powerful performance. I have not tried it and dare not comment.

Summary
If open source software says that it is recommended to install PHP5.3, then you should just use 5.3 instead of 5.5. You may think that it is compatible anyway and the performance may be better, so why not use the new one? That’s what I say, but you know that open source software is usually developed in a specific environment when it is developed. No matter how good the compatibility is, there will be unexpected surprises (no matter how powerful the team is, it is impossible to conduct compatibility testing on all function APIs, then It’s quite a terrible workload!), it will only be tested and optimized in a specific environment, and even if it knows there are compatibility issues, the team will not modify it to be compatible with higher versions. It’s not that they are rigid, but for safety. and stability are considered. In an open source atmosphere, we should have the awareness that “what’s enough is the best” rather than “the latest is the best”. For example, Joomla 3.1 does not run well in 5.4-5.5, and even the installation cannot be successful. But Drupal runs normally under 5.5.3 (on this machine). I think it is an isolated case? But it seems that unexpected errors have occurred during operation. I don’t know if it is a version problem. I hope it is not.

None-thread-safe or thread-safe

Apache generally chooses none-thread-safe, and IIS chooses the latter (FAST-CGI). I won’t explain it. Brother Xin is right.

The editor of Script House would like to add: In 2003 systems, we generally use isapi to load. If it is 2008 and above systems, we use fast-cgi.

Copy code The code is as follows:

TS refers to Thread Safety, which is thread safety. This version is generally selected when IIS is loaded in ISAPI mode.
NTS stands for None-Thread Safe. Generally, this version is selected when running in fast cgi mode, which has better performance.

Starting from the first Windows version of PHP 3.0.17 released on October 20, 2000, all versions are thread-safe. This is because unlike the Linux/Unix system that uses a multi-process working method, the Windows system uses a multi-process working method. How threads work. If you run PHP in CGI mode under IIS, it will be very slow. This is because the CGI mode is based on multi-process, not multi-thread. Generally, we will configure PHP to run in ISAPI mode. ISAPI is a multi-threaded mode, which is much faster. But there is a problem. Many commonly used PHP extensions are developed based on the multi-process thinking of Linux/Unix. When these extensions are run in ISAPI mode, they will go wrong and bring down IIS. Therefore, CGI mode is the safest way to run PHP under IIS, but CGI mode requires reloading and unloading the entire PHP environment for each HTTP request, and its consumption is huge.

In order to take into account the efficiency and security of PHP under IIS, Microsoft provides the FastCGI solution. FastCGI allows PHP processes to be reused instead of reopening a process for each new request. At the same time, FastCGI can also allow several processes to execute at the same time. This not only solves the problem of excessive consumption of CGI process mode, but also takes advantage of the fact that CGI process mode does not have thread safety issues.

Therefore, if you use ISAPI to run PHP, you must use the Thread Safe (thread safe) version; and if you use FastCGI mode to run PHP, there is no need to use thread safety check, use None Thread Safe (NTS, non-thread safe) version can better improve efficiency.

64-bit and 32-bit selection issues

If your system is 64-bit, choose 64-bit. If your system is 32-bit, choose 32-bit. No explanation, Brother Xin.

The editor of Script House added: In many cases we cannot guarantee that all the software we need to load in iis is 64-bit, and some software must be compatible with 32-bit format.

The original website address is: http://cnmaizi.com/tech/php-version.html
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP version development history (1995-2022) PHP version development history (1995-2022) Jun 01, 2020 pm 01:59 PM

As a PHP learner and developer, how can I not understand its history? The following PHP Chinese website will lead PHP enthusiasts to review the various historical versions of PHP.

Pagoda Panel Tutorial: A Simple Guide to PHP Version Switching Pagoda Panel Tutorial: A Simple Guide to PHP Version Switching Mar 05, 2024 am 09:27 AM

Pagoda Panel is a powerful and easy-to-use server management panel that can help users easily manage websites, databases, FTP and other services. In the process of using the Pagoda Panel, sometimes you need to switch the PHP version to adapt to different website needs. This article will provide you with a simple guide for PHP version switching, and provide specific code examples to help readers quickly complete the PHP version switching operation. First, we need to log in to the Pagoda panel and enter the website settings page. Find the "Website" option in the left navigation bar and click

Pagoda Panel Operation Guide: Sharing PHP Version Switching Tips Pagoda Panel Operation Guide: Sharing PHP Version Switching Tips Mar 04, 2024 am 10:42 AM

BTPanel is a powerful and easy-to-use server management panel that can help users easily manage servers, websites, databases and other services. As a website developer or administrator, it is very important to master the skills of switching PHP versions in the Pagoda panel. In this article, we will share how to operate and switch PHP versions in the Pagoda panel, and provide specific code examples to help readers better master this skill. 1. Log in to the Pagoda panel. First, enter the server IP address or domain name in the browser, and add the Pagoda

How to deal with errors caused by PHP version upgrade How to deal with errors caused by PHP version upgrade May 11, 2023 am 08:48 AM

When developing a website or application using PHP, version upgrades are a necessary task because each version brings new features and fixes known issues. However, PHP version upgrades can also introduce new bugs because the new version may no longer support the functionality or syntax of the older version. In this article, we will introduce how to deal with errors caused by PHP version upgrade to ensure the normal operation of the application. 1. Back up the application and server. Before upgrading the PHP version, you must back up the application and server. The backup application can be

How to update PHP version in Eclipse How to update PHP version in Eclipse Mar 28, 2024 pm 09:54 PM

Eclipse is a widely used integrated development environment (IDE) that can be used to develop projects in various programming languages. When using Eclipse to develop PHP projects, it is sometimes necessary to update the PHP version to adapt to new features or fix bugs. This article will explain how to update the PHP version in Eclipse and provide specific code examples. 1. Preparations for updating the PHP version Before updating the PHP version, we need to ensure that Eclipse and the PHP development environment have been installed. in addition,

How do version updates of PHP functions affect development? How do version updates of PHP functions affect development? Apr 18, 2024 pm 02:54 PM

Impact of PHP function version updates: Impact of new features: New features are introduced to facilitate the development of complex tasks. Fix the impact of the bug: Improve function behavior and improve code stability. Impact of behavior change: Most disruptive, requiring updates to code that uses the function. Best practices: Test updates in a test environment, check interactive code, and update affected dependencies.

New features of PHP7 version and their impact on mini program development New features of PHP7 version and their impact on mini program development Jul 04, 2023 pm 06:15 PM

New features of PHP7 version and their impact on mini program development. With the continuous development of technology, the Internet industry is also changing with each passing day. In recent years, mini programs have become a hot topic in mobile application development. At the same time, the release of PHP7 version has also become the focus of developers' attention. This article will explore the new features of the PHP7 version and analyze its impact on the development of small programs. 1. New features of PHP7 version As a major update of the PHP language, PHP7 version brings many new features and performance improvements. Here are a few important new features: Sex

Tips for quickly changing PHP version in a virtual machine Tips for quickly changing PHP version in a virtual machine Feb 27, 2024 pm 03:39 PM

Tips for quickly changing the PHP version in a virtual machine. With the continuous development of web development technology, PHP, as a popular back-end programming language, is constantly updated and iterated. Different projects may require different versions of PHP to support it. In a virtual machine environment, how to quickly and conveniently change the PHP version has become a concern for many developers. This article will introduce some tips and specific code examples to help developers quickly change the PHP version in a virtual machine. 1. Through the coexistence of multiple versions in the virtual machine, we can use the coexistence of multiple versions

See all articles