search
HomeBackend DevelopmentPHP8How to compile PHP 8.0 to MxSrvs tool on Mac

Preface

First of all, I would like to thank the author of MxSrvs for making developing PHP on Mac so easy and less cumbersome.
There are two reasons why I compile manually:

1. After all, PHP 8.1 has been out for a long time now. If I don’t use version 8, it seems that there will be hundreds of millions of dollars?? It’s unreasonable

2. The highest compiled version provided by MxSrvs is only up to PHP 7.4.6

Because when I wanted to compile PHP 7.2 before, I sent an email to communicate with the author, and the author's reply was that normal compilation would be enough. Finally, I found that the author provided some useful subsequent version compilations, so I did not actually compile them locally and adapt to the Mxsrvs tool.

Start preparations

Download PHP 8.0

PHP official download
下载PHP 8.0.16 版本
Go to /Applications/MxSrvs/bin under the main program path of MxSrvs, and create a php_8.0.16 file according to the naming rules of Mxsrvs folder, used to store our compiled files
There are two ways to enter the directory:

1. Click the small icon in the status bar of the MxSrvs tool-> Locate the directory-> Main program directory-> Double-click Enter the bin folder
MxSrvs 主程序目录

##2. Open Finder-> Applications-> Search on the right for

MxSrvs -> Double-click to enterMxSrvs -> Double-click to enter the bin folder
How to compile PHP 8.0 to MxSrvs tool on Mac

Compile starts

Unzip the downloaded file , get the [php-8.0.16] folder


How to compile PHP 8.0 to MxSrvs tool on MacCompilation command:

./buildconf --force./configure --prefix=/Applications/MxSrvs/bin/php_8.0.16 \--with-config-file-path=/Applications/MxSrvs/bin/php_8.0.16/etc \--with-mysqli=mysqlnd   \--with-pdo-mysql=mysqlnd   \--with-pear   \--with-zlib  \--with-curl  \--enable-mysqlnd \--enable-pdo   \--enable-fpm   \--enable-cli   \--without-iconv sudo make && sudo make installsudo cp php.ini-development /Applications/MxSrvs/bin/php_8.0.16/etc/php.ini

When the compilation is completed, you need to enter the (computer) password twice during compilation, because

sudoGenerally, during installation, you will not encounter too many missing components. If something is missing, basically just install whatever is missing

brew install xxxx

and then compile again.

Adapting MxSrvs

We restart the MxSrvs tool. At this time, you can see the PHP version we edited, switch to

8.0.16 , you cannot start by clicking the start button at this time. The startup error picture in the middle, because there is no screenshot, so...

The first step is to replace all the folder names configured during compilation

php_8.0.16 with php, because MxSrvs will change the current switched version directory to php when you switch the PHP version.

I used

VScode, dragged the folder to the editor, and then searched and replaced globally.

The second step is to copy the files

php-fpm.conf.default in the /Applications/MxSrvs/bin/php/etc directory to Rename the current directory to php-fpm.conf, and www.conf under /Applications/MxSrvs/bin/php/etc/php-fpm.d. default Copy to the current directory and rename it to www.conf

The third step is also a more important step. We need to edit the configuration file of the PHP version

/ Applications/MxSrvs/bin/php/etc/php.ini Compare line by line with the version pph.ini provided by MxSrvs, and then modify it to the corresponding configuration.

At this time, it can basically be said that all the work has been done and you can enjoy the results.


最终编译 PHP 8.0 适配 MxSrvs 完成

The above is the detailed content of How to compile PHP 8.0 to MxSrvs tool on Mac. 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

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)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version