Home>Article>Operation and Maintenance> PhpStudy installs PHP8 [detailed graphic and text explanation]

PhpStudy installs PHP8 [detailed graphic and text explanation]

咔咔
咔咔 Original
2021-03-02 12:02:18 15279browse
"

This article mainly installs PHP8 for phpstudy and uses it normally

"

Article Directory

Preface

1. Install PHP8

2. Run PHP8 error handling

3. Perfect combination of phpstudy and PHP8

4. Summary

##Foreword

In the above article "

PHP8 New Feature Interpretation (Development Code Example Demonstration)" explains the new features of PHP8. Due to the need for code demonstration, the PHP8 source code needs to be installed.

For the sake of convenience, it is not built on Linux, so the phpstudy inheritance environment is used directly.

Although the code in that article can run normally, the extensions inside are not turned on.

Next, Kaka will take you step by step to implement phpstudy integration with PHP8

Note:The above is a manual DIY, which is a bit troublesome. For this reason, php Chinese website developed An integrated environment tool that supports php8 is specially designed for learning and using PHP Chinese website. Download address://m.sbmmt.com/xiazai/gongju/1532

1. Install PHP8

Download addresshttps://windows.php.net/download #php-8.0

PhpStudy installs PHP8 [detailed graphic and text explanation]
Select the first download

After the download is completed, unzip the file and create the storage directory as php8

We all know that the installation directory of phpstudy is installed directly on the D drive in the new version, so as long as you do not modify the installation directory, all installation directories will be consistent.

This does provide great convenience for writing a group of articles, because everyone’s installation location is the same, which saves a lot of trouble.

Next, place the downloaded and decompressed PHP8 into the total PHP directory of phpstudy

PhpStudy installs PHP8 [detailed graphic and text explanation]
PHP8 storage directory

At this time you can Have fun playing.

The PHP version must be modified here!

PhpStudy installs PHP8 [detailed graphic and text explanation]
Modify the PHP8 environment

2. Run PHP8 error handling

Some partners may encounter the following errors when installing PHP8.

The Kaka test is that this error will not occur in the win10 professional version, but an error will occur in the win10 home version.

If you complete the first step and restart the environment, you find that PHP cannot run or an error 502 is reported.

Then you directly cmd toD:\phpstudy_pro\Extensions\php\php8.0.2ntsThis location executesphp -v

If found The following error occurredPHP Warning: 'C:\Windows\SYSTEM32\VCRUNTIME140.dll' 14.0 is not compatible with this PHP build linked with 14.28 in Unknown on line 0

Enter to this URLhttps://www.yuque.com/u30882/rx39g7/kns2a2, Kaka has downloaded the software, just click in and download it directly.

You need to restart your computer after the download is complete.

Then you can run PHP8 perfectly

3. Perfect combination of phpstudy and PHP8

After the first and second steps, the environment has been set up and the PHP file can also be run.

But this is the only way to run PHP files. At this time, MySQL cannot be connected.

That’s because we downloaded PHP8 ourselves, and all the extensions and configuration information in it have not been modified.

So the problem is that all the extensions in the PHP8 configuration file I downloaded are turned off.

At this time, you need to enable the corresponding extensions one by one. If you don’t know what extensions you need to enable.

Open your phpstudy and click on the website. There is management on the right, see what extensions were enabled in the previous PHP environment, and then follow the example

Here All of them have been opened by Kaka.

PhpStudy installs PHP8 [detailed graphic and text explanation]
PHP8 extension

You can open them one by one at the locations in the picture below, or you can modify them directly in the php.ini file, just change # Just remove the comment in front of ##extension.

PhpStudy installs PHP8 [detailed graphic and text explanation]Open directly in the php.ini file
For example, if you need to open curl, just remove the

;in front.

PhpStudy installs PHP8 [detailed graphic and text explanation]Open the extension
You will find that after opening these extensions according to the previous PHP environment, you will find that there is still no check in the extension of the panel. .

But I’ve obviously turned it on! Why is the extension still not opened?

Don’t worry, still go to the php.ini file, search for such a word

extension_dir, and then modify the extension location

PhpStudy installs PHP8 [detailed graphic and text explanation]Modify the extension location
Restart your PHP environment, and then test it. The test in this article uses tp6

The test code is to query the data of the database, provided that you configure the database information OK! I won’t write it here

PhpStudy installs PHP8 [detailed graphic and text explanation]
Query data
PhpStudy installs PHP8 [detailed graphic and text explanation]
Return results

4. Summary

At this point, the integration of phpstudy with PHP8 is considered complete and more testing can be invested.

Here are some points to note

  • Be sure to restart the environment after modifying the configuration file
  • I don’t know how to open it What extension, open your original phpstudy and follow the example
  • Be sure to modify the extension directory after opening the extension
  • When running php -v, an error message is reported See if it’s the same as Kaka

Persistence in learning, persistence in blogging, and persistence in sharing are the beliefs that Kaka has always upheld since his career. Hope In the huge Internet, Kaka’s articles can bring you a little bit of help. I am Kaka, see you in the next issue.

The above is the detailed content of PhpStudy installs PHP8 [detailed graphic and text explanation]. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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