search
HomeBackend DevelopmentPHP7How to upgrade ThinkPHP3.2.3 from php5 to php7

This article will introduce to you how to upgrade ThinkPHP3.2.3 from php5 to php7. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

How to upgrade ThinkPHP3.2.3 from php5 to php7

First of all, does ThinkPHP3.2.3 support php7? Absolutely.

Under windows, the previous project was deployed in the Apache2.4.17 php5.x version. Because the customer's network security scan found many vulnerabilities, including high-risk vulnerabilities in apache and php, as many as hundreds of times. , in urgent need of repair, if not repaired, there will be a risk of site closure.

So I contacted the software supplier, who promised to cooperate with the upgrade, but ultimately failed to upgrade. The reply given was that ThinkPHP3.2.3 cannot be deployed in php7.

So I had to rely on myself and fumbled for three or four days. Finally, the upgrade was successful. Now I would like to share with you the general process.

1. Upgrade apache, download address http://httpd.apache.org/download.cgi, the downloaded version is 2.4.33

The most important one is the configuration file as shown below :

apache loading php support

PHPIniDir d:/GPS-LOCK/php/php.ini

LoadModule php7_module D:/ GPS-LOCK/php/php7apache2_4.dll

I have encountered many problems in this step. If the PHPIniDir path is enabled, apache cannot start. Finally, it is found that the php.ini file references php_ptheads.dll multi-threading. . After repeated attempts, the problem was solved.

2. Upgrade php, download address: https://windows.php.net/download/ What is downloaded here is 7.2.26,

Now we will summarize the problems expected when upgrading php7

1. Here you need to install the compiled vc class library version corresponding to php7, vc_redist.x64.exe, the installation is vc15

2, sql server database support

This is because php7 does not load the sql server related dll by default

3. You need to download Microsoft Drivers for PHP for SQL Server https://www.microsoft.com/en-us /download/details.aspx?id=20098, I downloaded version 7.2

Modify the location file as follows

4. php.ini file in php7 , just omit php_.dll for ext and configure it as shown above. Currently, you need to copy the decompressed file to the php\ext directory

3. I thought the system could run normally under php7, but the project used multi-threading , php needs to support pthreads, and it is almost crashing now. After adding extension=pthreads to the php.ini file, apache cannot start again. It turns out that ptheads needs to be run in cli mode. The ptheads download address is https://windows.php.net/downloads/pecl/releases/pthreads/

Unzip the download package

1. Put pthreadVC2. The dll file is placed in the php root directory

2. Copy php_pthreads.dll to the php\ext directory.

Start apache again and find that it cannot be started. After searching a lot of information, it turns out that ptheads needs Running in cli mode, my solution is to create two php.ini configuration files, one for the site to use php.ini and the other php-cli.ini file for ptheads to use. The contents of the files are the same. At this point, the upgrade is finally completed. .

Recommended learning: php video tutorial

The above is the detailed content of How to upgrade ThinkPHP3.2.3 from php5 to php7. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software