How to solve the inconsistency between extensions in phpinfo and php -m under Mac?
癸亥王
癸亥王 2021-01-26 19:56:51
0
3
1297

I want to debug redis under mac. When compiling and installing phpredis, the phpize that comes with mac11.1 system has an error. So I upgraded php to 7.4.13 and then compiled and installed phpredis to 7.4.13. Now the problem is in the web page phpinfo. There is no redis extension, and the command php -m shows that redis is enabledQQ20210126-195429@2x.pngQQ20210126-195614@2x.png

癸亥王
癸亥王

reply all (3)
癸亥王

The methods of the two teachers above were not successful. Finally, I installed nginx and solved it directly

    right-chen

    Mac comes with a PHP environment. Have you installed a new PHP environment? I see that the PHP addresses in the two pictures are different, one is under /usr/local/opt and the other is under /usr/local/etc. Maybe the redis you installed has been extended to the built-in PHP environment, and the web access is your newly installed PHP environment

      灭绝师太

      The loaded configuration file in your phpinfo is /usr/local/etc/php/7.4/php.ini. Open this configuration file, reference redis in php.ini, add extension="redis.so", and then find The path of redis.so. After finding the path, change the reference path of redis.so in php.ini, for example: extension= '/usr/lib64/php/modules/redis.so', then restart php, systemctl restart php-fpm and then Restart apache, /bin/systemctl stop httpd.service/bin/systemctl start httpd.service and then check redis in the info file and it will start successfully~

        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!