swoole What should I do if there is a mac compilation error? Possible errors when installing swoole on mac
Please read this before proceeding
1. Use pecl to install swoole (not installed)
In April 2018, due to changes in homebrew, it was impossible to use brew install to install php extensions. Now it is installed using pecl. The method of pecl installing swoole is:
pecl install swoole
Appears in the options Fill in yes or no
Possible errors and solutions
1 fatal error: 'openssl/ssl.h' file not found
Solution 1: cp -R /usr/local/opt/openssl/include/openssl /usr/local/include
Solution 2: ln -s /usr/local/opt/openssl/include/openssl /usr/local/include/ openssl
Reason: Generally, software installed with brew will automatically put the files that need to be included in /usr/local/include, but I don’t know why it was not put there when installing openssl, so I have to copy it myself. In the past, the best way was actually to make a link, that is, use solution 2!
2 error: Cannot find libpq-fe.h. Please confirm the libpq or specify correct PostgreSQL(libpq) installation path
Solution brew reinstall PostgreSQL
Cause: Possible PostgreSQL is not installed
3 fatal error: 'hiredis/hiredis.h' file not found
Most of the reasons for this are because hiredis is not installed. Use brew search hiredis to see if it is. Installation. If there is no installation, just use brew install hiredis to install it. Then pecl install swoole again.
Careful children will find that after brew install hiredis, there is an extra hiredis in /usr/local/include, and this It is a soft link, linked to /usr/local/Cellar/hiredis/0.13.3/include/hiredis
The result is still an error, it is not solved, and the ability is limited.
2. Change it Way to install swoole (perfect solution)
2.1 Download swoole
sudo pecl download swoole
2.2 Compile and install
tar zxvf swoole-4.2.12.tgz // 注意自己下载的版本,可能不一定 cd swoole-4.2.12 phpize ./configure --enable-openssl --enable-http2 --enable-sockets --enable-mysqlnd -with-openssl-dir=/usr/local/Cellar/openssl/1.0.2s/ make clean && make && sudo make install
2.3 Encounter an error
mkdir: /usr/local/Cellar/php@7.1/7.1.30/pecl: File exists mkdir: /usr/local/Cellar/php@7.1/7.1.30/pecl: No such file or directory make: *** [install-modules] Error 1 // 大致意思就是 pecl 文件夹存在,但是打不开 // 我的pecl是软连接过来的 不知道为什么打不开
2.4 Solution
Modify /usr/local/Cellar/php@7.1/7.1.30/bin/php-config
extension_dir=‘/usr/local/Cellar/php@7.1/7.1.30/pecl/20160303‘ 中的 『pecl』 换成 『lib/php』 extension_dir=‘/usr/local/Cellar/php@7.1/7.1.30/lib/php/20160303‘
2.5 Recompile
./configure --enable-openssl --enable-http2 --enable-sockets --enable-mysqlnd -with-openssl-dir=/usr/local/Cellar/openssl/1.0.2s/ make clean && make && sudo make install
2.6 Add swoole.so
Modify php.ini and add a line at the end of the file
extension = "/usr/local/Cellar/php@7.1/7.1.30/lib/php/20160303/swoole.so"
It really hurts to install swoole on mac
The above is the detailed content of What to do if swoole mac compilation error occurs. For more information, please follow other related articles on the PHP Chinese website!

The article outlines ways to contribute to the Swoole project, including reporting bugs, submitting features, coding, and improving documentation. It discusses required skills and steps for beginners to start contributing, and how to find pressing is

Article discusses extending Swoole with custom modules, detailing steps, best practices, and troubleshooting. Main focus is enhancing functionality and integration.

The article discusses using Swoole's asynchronous I/O features in PHP for high-performance applications. It covers installation, server setup, and optimization strategies.Word count: 159

Article discusses configuring Swoole's process isolation, its benefits like improved stability and security, and troubleshooting methods.Character count: 159

Swoole's reactor model uses an event-driven, non-blocking I/O architecture to efficiently manage high-concurrency scenarios, optimizing performance through various techniques.(159 characters)

Article discusses troubleshooting, causes, monitoring, and prevention of connection issues in Swoole, a PHP framework.

The article discusses tools and best practices for monitoring and optimizing Swoole's performance, and troubleshooting methods for performance issues.

Abstract: The article discusses resolving memory leaks in Swoole applications through identification, isolation, and fixing, emphasizing common causes like improper resource management and unmanaged coroutines. Tools like Swoole Tracker and Valgrind


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

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version
Useful JavaScript development tools

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

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download
The most popular open source editor