search
HomeBackend DevelopmentPHP7Introduction to the process of upgrading ThinkPHP3.2.3 from php5 to php7

Introduction to the process of upgrading 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 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 previously 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. After groping for three or four days, I finally upgraded successfully. Now I will share with you the general process.

Recommended (free): PHP7

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

Encountered many problems in this step, enable the PHPIniDir path, Apache could not start. Finally, it was found that the php.ini file referenced 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, In the php.ini file of php7, ext omits php_.dll. Just configure it as shown above. Currently, you need to copy the decompressed file to the php\ext directory.

3. I think the system can run normally under php7. As a result, the project uses multi-threading and requires PHP to support pthreads. It is about to crash. 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. .

Since the original poster was not born in a PHP major, he took many detours, but the loophole was finally fixed. If everyone also encounters this problem, you can communicate and discuss it together.

The above is the detailed content of Introduction to the process of upgrading 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

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)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

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.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)