This article mainly installs PHP8 for PHPStudy and uses it normally

preface

In the above interpretation of the PHP8 new features, due to the need to code demo need to install PHP8 source code.

In order to facilitate not build on Linux, directly use the PHPStudy inheritance environment to use.

In that case, although the code works, the extension is not open.

The next step will take you through the phpStudy integration with PHP8

Install PHP8

Download address https://windows.php.net/download#php-8.0

After downloading, decompress the file and set up the directory as PHP8

It is well known that the phpStudy installation directory is installed directly on drive D in the new version, so as long as you do not change the installation directory, all installation directories will be the same.

This is really a great convenience for the article group, because everyone has the same installation location and saves a lot of trouble.

Next, place the downloaded and unzipped PHP8 in the phpStudy master PHP directory

Then you can have fun.

Make sure to change the PHP version here!

Second, running PHP8 error processing

Some partners may experience the following error when installing PHP8.

Click test is in Win10 professional version is not going to occur this error, but in Win10 home version will occur an error.

If you restart the environment after executing step 1 and PHP does not run, or error 502 is reported.

Then run PHP -v directly to D: phpstudy_pro\Extensions\ PHP \php8.0.2nts

PHP Warning: C:\Windows\SYSTEM32\ vcrUntime140.dll ‘14.0 is not compatible with this PHP build linked with 14.28 in Unknown on line 0

Into this web site, https://www.yuque.com/u30882/rx39g7/kns2a2, kaka has the software download, click enter directly download it.

You need to reboot your computer after downloading.

Then you can run PHP8 perfectly

3. Perfect combination of PHPStudy and PHP8

With steps 1 and 2, the environment is set up and you can also run PHP files.

But that’s all you can do to run PHP files. MySQL can’t connect at this point.

That’s because PHP8 was downloaded by us and all the extensions and configuration information in it was not changed.

The problem is that all extensions in the PHP8 configuration file you download are turned off.

At this point, you need to open the corresponding extensions one by one, if you do not know which extensions need to be opened.

Open up your PHPStudy and go to the site. There's an admin on the right. See what extensions have been enabled in your previous PHP environment

Here’s what kaka has all opened.

You can either open the extension one by one as shown in the following image, or change it directly in the php.ini file by removing the comment at the end of extension.

To open curl, use the first curl. Remove it.

You will find that you have opened all the extensions in the previous PHP environment, and there is still no check in the panel extension.

But I turned it on! Why is the extension still not open?

Don’t worry, go to the php.ini file and search for such a word extension_dir, then modify the extension location

Restart your PHP environment and test it. This test uses TP6

Test code is query database data, the premise is that you configure the database information! I’m not going to write it here

Four,

At this point, the phpStudy integration with PHP8 is complete and more tests can be put in.

Here are a few caveats

  • After modifying the configuration file, restart the environment
  • Don’t know what extension to open, open your original PHPStudy and follow suit
  • Modify the extension directory after the extension is enabled
  • When running PHP -v, check to see if it clicks

Adhering to learning, blogging and sharing is the belief that Kakha has been upholding since she started her career. I hope the articles on the Internet can bring you a little help. I’m Kaka. See you next time.