Home Backend Development PHP Tutorial Why is the manually compiled php-redis module that is not displayed in phpinfo() after installing PHP using brew on mac M2?

Why is the manually compiled php-redis module that is not displayed in phpinfo() after installing PHP using brew on mac M2?

Apr 01, 2025 am 09:27 AM
redis nginx Browser macos cos Why red

Why is the manually compiled php-redis module that is not displayed in phpinfo() after installing PHP using brew on mac M2?

After installing PHP with Brew on Mac M2 system, manually compile and install the php-redis extension but cannot be displayed in phpinfo()

On macOS M2 system, after using Homebrew to install PHP, some users encountered problems when manually compiling and installing the php-redis extension: the command line can use the redis extension normally, the php -m command can also display redis, php -r "if (new Redis() == true){ echo "\r\n OK \r\n"; }" command also returns OK, but phpinfo() cannot display redis-related information.

The php.ini file path is confirmed to be /opt/homebrew/etc/php/7.3/php.ini , and the file is loaded through php -i | grep Loaded , and extension=redis configuration has been added to it.

The root cause of the problem may be the difference between the PHP configuration file and the CLI environment, and the configuration of PHP-FPM. The following provide troubleshooting steps:

  1. Verify the consistency of PHP version: Use php -v to view the command line PHP version, and then access phpinfo() page through the browser to confirm whether the PHP version used by the web server is consistent with the command line version. Version inconsistency is a common reason.

  2. Check PHP-FPM configuration: If you use PHP-FPM, you need to check its configuration file (usually located in /opt/homebrew/etc/php/7.3/php-fpm.d/ directory) to make sure it loads the correct php.ini file and that the file contains extension=redis configuration.

  3. Restart the web server: After modifying the configuration file, be sure to restart the web server for the changes to take effect (for example, restart Nginx using sudo nginx -s reload ).

  4. Confirm the extension file path: Check whether the extension_dir setting in the php.ini file is correct, and make sure that the redis.so file is located in this directory. Use php -i | grep extension_dir to view the current extension directory.

  5. Permissions issue: Make sure the web server has permission to read the redis.so file and php.ini file. Adjust file permissions if necessary.

  6. Compilation options: Confirm that the PHP version used when compiling php-redis is the same as the PHP version of the system, and the compilation parameters are correct.

If the above steps still fail to resolve the problem, it is recommended to check the system log and PHP error log to obtain more detailed error information for further troubleshooting. Check each step carefully to make sure all configurations are correct.

The above is the detailed content of Why is the manually compiled php-redis module that is not displayed in phpinfo() after installing PHP using brew on mac M2?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to run the h5 project How to run the h5 project Apr 06, 2025 pm 12:21 PM

Running the H5 project requires the following steps: installing necessary tools such as web server, Node.js, development tools, etc. Build a development environment, create project folders, initialize projects, and write code. Start the development server and run the command using the command line. Preview the project in your browser and enter the development server URL. Publish projects, optimize code, deploy projects, and set up web server configuration.

How to correctly display the locally installed 'Jingnan Mai Round Body' on the web page? How to correctly display the locally installed 'Jingnan Mai Round Body' on the web page? Apr 05, 2025 pm 10:33 PM

Using locally installed font files in web pages Recently, I downloaded a free font from the internet and successfully installed it into my system. Now...

Does H5 page production require continuous maintenance? Does H5 page production require continuous maintenance? Apr 05, 2025 pm 11:27 PM

The H5 page needs to be maintained continuously, because of factors such as code vulnerabilities, browser compatibility, performance optimization, security updates and user experience improvements. Effective maintenance methods include establishing a complete testing system, using version control tools, regularly monitoring page performance, collecting user feedback and formulating maintenance plans.

Why does negative margins not take effect in some cases? How to solve this problem? Why does negative margins not take effect in some cases? How to solve this problem? Apr 05, 2025 pm 10:18 PM

Why do negative margins not take effect in some cases? During programming, negative margins in CSS (negative...

What are the advantages of H5 page production What are the advantages of H5 page production Apr 05, 2025 pm 11:48 PM

The advantages of H5 page production include: lightweight experience, fast loading speed, and improving user retention. Cross-platform compatibility, no need to adapt to different platforms, improving development efficiency. Flexibility and dynamic updates, no audit required, making it easier to modify and update content. Cost-effective, lower development costs than native apps.

The text under Flex layout is omitted but the container is opened? How to solve it? The text under Flex layout is omitted but the container is opened? How to solve it? Apr 05, 2025 pm 11:00 PM

The problem of container opening due to excessive omission of text under Flex layout and solutions are used...

How to achieve horizontal scrolling effect of horizontal options by rotating elements in CSS? How to achieve horizontal scrolling effect of horizontal options by rotating elements in CSS? Apr 05, 2025 pm 10:51 PM

How to achieve horizontal scrolling effect of horizontal options in CSS? In modern web design, how to achieve a horizontal tab-like effect and support the mouse...

How to use locally installed font files on web pages? How to use locally installed font files on web pages? Apr 05, 2025 pm 10:57 PM

How to use locally installed font files on web pages Have you encountered this situation in web page development: you have installed a font on your computer...

See all articles