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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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 register an account on Ouyi Exchange Ouyi Exchange Registration Tutorial How to register an account on Ouyi Exchange Ouyi Exchange Registration Tutorial Apr 24, 2025 pm 02:06 PM

The steps to register an Ouyi account are as follows: 1. Prepare a valid email or mobile phone number and stabilize the network. 2. Visit Ouyi’s official website. 3. Enter the registration page. 4. Select email or mobile phone number to register and fill in the information. 5. Obtain and fill in the verification code. 6. Agree to the user agreement. 7. Complete registration and log in, carry out KYC and set up security measures.

Redis: Understanding Its Architecture and Purpose Redis: Understanding Its Architecture and Purpose Apr 26, 2025 am 12:11 AM

Redis is a memory data structure storage system, mainly used as a database, cache and message broker. Its core features include single-threaded model, I/O multiplexing, persistence mechanism, replication and clustering functions. Redis is commonly used in practical applications for caching, session storage, and message queues. It can significantly improve its performance by selecting the right data structure, using pipelines and transactions, and monitoring and tuning.

How to register an account on Sesame Open Exchange? Tutorial on Registration of Sesame Open Exchange How to register an account on Sesame Open Exchange? Tutorial on Registration of Sesame Open Exchange Apr 24, 2025 pm 02:00 PM

Registering a Sesame Door Account requires 7 steps: 1. Prepare a valid email or mobile phone number and a stable network; 2. Visit the official website; 3. Enter the registration page; 4. Select and fill in the registration method; 5. Obtain and fill in the verification code; 6. Agree to the user agreement; 7. Complete registration and log in, it is recommended to carry out KYC and set security measures.

Binance download link Binance download path Binance download link Binance download path Apr 24, 2025 pm 02:12 PM

To safely download the Binance APP, you need to go through the official channels: 1. Visit the Binance official website, 2. Find and click the APP download portal, 3. Choose to scan the QR code, app store, or directly download the APK file to download to ensure that the link and developer information are authentic, and enable two-factor verification to protect the security of the account.

How to register an account on Binance Exchange Binance Exchange Registration Tutorial How to register an account on Binance Exchange Binance Exchange Registration Tutorial Apr 24, 2025 pm 02:03 PM

The steps to register a Binance account include: 1. Prepare a valid email or mobile phone number and a stable network; 2. Visit Binance official website; 3. Enter the registration page; 4. Select the registration method; 5. Fill in the registration information; 6. Agree to the user agreement; 7. Complete verification; 8. Obtain and fill in the verification code; 9. Complete registration.

NGINX and Apache: Understanding the Key Differences NGINX and Apache: Understanding the Key Differences Apr 26, 2025 am 12:01 AM

NGINX and Apache each have their own advantages and disadvantages, and the choice should be based on specific needs. 1.NGINX is suitable for high concurrency scenarios because of its asynchronous non-blocking architecture. 2. Apache is suitable for low-concurrency scenarios that require complex configurations, because of its modular design.

Download the official website of Ouyi Exchange app for Apple mobile phone Download the official website of Ouyi Exchange app for Apple mobile phone Apr 28, 2025 pm 06:57 PM

The Ouyi Exchange app supports downloading of Apple mobile phones, visit the official website, click the "Apple Mobile" option, obtain and install it in the App Store, register or log in to conduct cryptocurrency trading.

macOS vs. Linux: Exploring the Differences and Similarities macOS vs. Linux: Exploring the Differences and Similarities Apr 25, 2025 am 12:03 AM

macOSandLinuxbothofferuniquestrengths:macOSprovidesauser-friendlyexperiencewithexcellenthardwareintegration,whileLinuxexcelsinflexibilityandcommunitysupport.macOS,developedbyApple,isknownforitssleekinterfaceandecosystemintegration,whereasLinux,beingo

See all articles