


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 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.
Recommended (free): PHP7
1. Upgrade apache, download address http:// httpd.apache.org/download.cgi, the downloaded version is, 2.4.33
The most important thing is the configuration file as shown below:
apache Load php support
PHPIniDir d:/GPS-LOCK/php/php.ini
LoadModule php7_module D:/GPS-LOCK/php/php7apache2_4.dll
Encountered in this step After many problems, apache could not start when the PHPIniDir path was enabled. 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. php.ini file in php7 , ext is omitted php_.dll
Just configure it as shown above. Currently, you need to copy the decompressed file to the php\ext
directory
3. Think the system is ready It runs 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 author 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 Let's talk about the difficult road of upgrading ThinkPHP3.2.3 from php5 to php7. For more information, please follow other related articles on the PHP Chinese website!

php5和php8的区别在性能、语言结构、类型系统、错误处理、异步编程、标准库函数和安全性等方面。详细介绍:1、性能提升,PHP8相对于PHP5来说在性能方面有了巨大的提升,PHP8引入了JIT编译器,可以对一些高频执行的代码进行编译和优化,从而提高运行速度;2、语言结构改进,PHP8引入了一些新的语言结构和功能,PHP8支持命名参数,允许开发者通过参数名而不是参数顺序等等。

在php5中,我们可以使用fsockopen()函数来检测TCP端口。这个函数可以用来打开一个网络连接和进行一些网络通信。但是在php7中,fsockopen()函数可能会遇到一些问题,例如无法打开端口、无法连接到服务器等。为了解决这个问题,我们可以使用socket_create()函数和socket_connect()函数来检测TCP端口。

php7.0安装mongo扩展的方法:1、创建mongodb用户组和用户;2、下载mongodb源码包,并将源码包放到“/usr/local/src/”目录下;3、进入“src/”目录;4、解压源码包;5、创建mongodb文件目录;6、将文件复制到“mongodb/”目录;7、创建mongodb配置文件并修改配置即可。

解决 PHP 7.0 中插件未显示已安装问题的方法:检查插件配置并启用插件。重新启动 PHP 以应用配置更改。检查插件文件权限,确保其正确。安装丢失的依赖项,以确保插件正常运行。如果其他步骤均失败,则重建 PHP。其他可能原因包括插件版本不兼容、加载错误版本或 PHP 配置问题。

php5改80端口的方法:1、编辑Apache服务器的配置文件中的端口号;2、辑PHP的配置文件以确保PHP在新端口上工作;3、重启Apache服务器,PHP应用程序将开始在新的端口上运行。

PHP8相较于PHP7在性能、新特性和语法改进、类型系统、错误处理和扩展等方面都有一些优势和改进。然而,选择使用哪个版本要根据具体的需求和项目情况来决定。详细介绍:1、性能提升,PHP8引入了Just-in-Time(JIT)编译器,可以提高代码的执行速度;2、新特性和语法改进,PHP8支持命名参数和可选参数的声明,使得函数调用更加灵活;引入了匿名类、属性的类型声明等等。

php7.0安装部署的方法:1、到PHP官网下载与本机系统对应的安装版本;2、将下载的zip文件解压到指定目录;3、打开命令行窗口,在“E:\php7”目录下运行“php -v”命令即可。

PHP服务器环境常见的解决方法包括:确保已安装正确的PHP版本和已复制相关文件到模块目录。临时或永久禁用SELinux。检查并配置PHP.ini,确保已添加必要的扩展和进行正确设置。启动或重启PHP-FPM服务。检查DNS设置是否存在解析问题。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version
Chinese version, very easy to use
