简体   繁体   English

在MAMP中缺少mysql扩展

[英]missing mysql extension in MAMP

I'm just shifting from wamp to mamp on windows. 我只是在Windows上从潮湿到潮湿。

Through mamp every thing is working perfectly (WordPress or PHP Projects). 通过mamp,一切都可以正常运行(WordPress或PHP项目)。

1) In cmd when I work with wp-cli.phar file, it's give me the following error 1)在cmd中使用wp-cli.phar文件时,出现以下错误

your php installation appears to be missing the mysql extension which is required by wordpress

I check the php.ini files, extension path is perfect, php_mysql.dll isn't here. 我检查了php.ini文件,扩展路径是完美的,php_mysql.dll不在这里。 then I change PHP version 5.6.13 here I have php_mysql.dll extension but problem is same. 然后我将PHP版本5.6.13更改为php_mysql.dll,但问题是相同的。

2) Also set the environment variable C:\\MAMP\\bin\\php\\php7.0.0; 2)同时设置环境变量C:\\MAMP\\bin\\php\\php7.0.0;

When I check PHP Variable Path with phpinfo(); 当我用phpinfo()检查PHP变量路径时; path are 路径是

Why it show wamp and mamp both path ? 为什么它同时显示wamp和mamp路径?

Both problem have relation with each other ? 这两个问题有关系吗?

The path variable holds the windows OS' path environment variable's contents. path变量保存Windows OS的path环境变量的内容。 Apparently, you have multiple versions of php installed: v5.5 and v7.0 and MAMP uses v7.0. 显然,您安装了多个版本的php:v5.5和v7.0,而MAMP使用v7.0。

If you check out mysql's documentation on mysql extension , you will see that: 如果查看有关mysql extension的 mysql文档,您将看到:

This extension is deprecated as of PHP 5.5.0, and has been removed as of PHP 7.0.0. 自PHP 5.5.0起不推荐使用此扩展,自PHP 7.0.0起已删除该扩展。 Instead, either the mysqli or PDO_MySQL extension should be used. 相反,应使用mysqli或PDO_MySQL扩展名。 See also the MySQL API Overview for further help while choosing a MySQL API. 另请参见MySQL API概述以获取选择MySQL API时的更多帮助。

So, if you want to keep using mysql extension, then you need to downgrade the php version you use. 因此,如果您想继续使用mysql扩展名,则需要降级使用的php版本。

The other option is to upgrade to at least wordpress v3.9 because it can use mysqli extension instead of mysql . 另一个选择是至少升级到wordpress v3.9,因为它可以使用mysqli扩展名而不是mysql

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM