Does yii2 support php7?
Let’s first talk about the Yii framework PHP running environment.
Yii version 2.0.12 uses the \yii\base\Object class, and Object is used as the class name. PHP7.2 reports an error. (Recommended learning: yii tutorial)
The minimum available version of Yii2 for PHP7.2 is 2.0.13.
Provides several upgrade methods.
The project uses Composer to manage bower and npm front-end resources.
Install the latest version of composer-asset-plugin
composer global require "fxp/composer-asset-plugin"
Specify the class library update
composer update yiisoft/yii2 yiisoft/yii2-composer bower-asset/jquery.inputmask
Composer records are as follows
Loading composer repositories with package information Updating dependencies (including require-dev) Reading bower.json of bower-asset/yii2-pjax (2.0.7.1)GitHub API limit (60 calls/hr) is exhausted, could not fetch https://api.github.com/repos/yiisoft/jquery-pjax/commits/aef7b953107264f00234902a3880eb50dafc48be. Create a GitHub OAuth token to go over the API rate limit. You can also wait until 2019-02-15 18:54:52 for the rate limit to reset.Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+bw-hz-dev-v14+2019-02-15+1755to retrieve a token. It will be stored in "/data/home/hanguangchao/.config/composer/auth.json" for future use by Composer. Token (hidden):Package operations: 1 install, 2 updates, 1 removal - Removing bower-asset/jquery.inputmask (3.3.7) - Updating yiisoft/yii2-composer (2.0.5 => 2.0.7): Loading from cache - Installing bower-asset/inputmask (3.3.11): Downloading (100%) - Updating yiisoft/yii2 (2.0.12 => 2.0.16): Loading from cacheWriting lock fileGenerating autoload files
The project configuration does not manage bower and npm resources through Composer
If your Yii2 is used as an interface application or micro-framework, you do not need JS, CSS, or manage front-end resources by yourself. You can remove dependencies on bower and npm resources when installing updates.
Modify composer.json
"require" : { "yiisoft/yii2": "2.0.16" }, "replace": { "bower-asset/inputmask": ">=3.2.0" }
Upgrade on demand
composer update yiisoft/yii2 yiisoft/yii2-composer bower-asset/jquery.inputmask
If there is an error, it is usually a front-end resource dependency issue , just remove it.
The above is the detailed content of Does yii2 support php7?. For more information, please follow other related articles on the PHP Chinese website!

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

This tutorial demonstrates Yii Framework's timestamp management. It details using TimestampBehavior for automatic created_at and updated_at updates, offering customization options and comparing it to manual updates, database triggers, and custom be

The article discusses best practices for deploying Yii applications in cloud-native environments, focusing on scalability, reliability, and efficiency through containerization, orchestration, and security measures.

This article compares the PHP frameworks Yii and Laravel. Yii prioritizes speed and structure, while Laravel emphasizes developer experience and flexibility. Though both handle large-scale applications, Yii offers superior raw performance, while La

This article introduces Yii, a high-performance PHP framework ideal for large-scale web applications. It highlights Yii's speed, security, and robust architecture (MVC), emphasizing its advantages over other frameworks like Laravel, Symfony, and Cod

This article analyzes Yii framework's strengths and weaknesses. It highlights Yii's high performance, robust security, rapid development capabilities, and extensibility, but also notes a steeper learning curve and potential complexity for smaller pr

This article compares Yii and ThinkPHP (TP) frameworks. The choice depends on project scale and developer experience. Yii, robust and mature, suits large, complex projects needing high performance. TP, simpler and faster for development, is better f

This article details how to call and organize common functions in Yii applications. It advocates encapsulating functions within classes, ideally in a dedicated app/helpers directory, for improved reusability and maintainability. Different approache

The article discusses key considerations for using Yii in serverless architectures, focusing on statelessness, cold starts, function size, database interactions, security, and monitoring. It also covers optimization strategies and potential integrati
