0

I'm just shifting from wamp to mamp on windows.

Through mamp every thing is working perfectly (WordPress or PHP Projects).

1) In cmd when I work with wp-cli.phar file, it's give me the following error

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. then I change PHP version 5.6.13 here I have php_mysql.dll extension but problem is same.

2) Also set the environment variable C:\MAMP\bin\php\php7.0.0;

When I check PHP Variable Path with phpinfo(); path are

Why it show wamp and mamp both path ?

Both problem have relation with each other ?

A Wahab
  • 41
  • 1
  • 8
  • 1
    in php 7 mysql_* extension is depreciated, use mysqli_* instead. – mitkosoft Apr 07 '16 at 12:20
  • 1
    Slight correction there, @mitkosoft - in PHP7 the `mysql_*` extension isn't deprecated, its **removed entirely**. It was marked deprecated in PHP 5.5.0. Though you are indeed correct, use `mysqli_*` or PDO instead ;-) – Qirel Apr 07 '16 at 12:29
  • used But it gives me same error "your php installation appears to be missing the mysql extension which is required by wordpress" – A Wahab Apr 07 '16 at 12:29
  • @AWahab "used" what? PHP7? MySQLi? – Qirel Apr 07 '16 at 12:31
  • You have added your old WAMPServer folder to the Windows PATH. You will have to remove those references from your PATH. **Note** you should never have added them to the path on the first place, its not necessary, and destroys the abilitly of WAMPServer to switch between versions of Apache & PHP – RiggsFolly Apr 07 '16 at 12:32
  • Also if you stick with WAMPServer 3 you can install ADDONs for PHP7.0/7.0.1/7.0.2/7.0.3/7.0.4/7.0.5, PHP7.0.5 being the latest release of PHP7. And WAMPServer3.0.3 installs straight over WAMPServer2.5 – RiggsFolly Apr 07 '16 at 12:45

1 Answers1

2

The path variable holds the windows OS' path environment variable's contents. Apparently, you have multiple versions of php installed: v5.5 and v7.0 and MAMP uses v7.0.

If you check out mysql's documentation on mysql extension, you will see that:

This extension is deprecated as of PHP 5.5.0, and has been removed as of PHP 7.0.0. Instead, either the mysqli or PDO_MySQL extension should be used. See also the MySQL API Overview for further help while choosing a MySQL API.

So, if you want to keep using mysql extension, then you need to downgrade the php version you use.

The other option is to upgrade to at least wordpress v3.9 because it can use mysqli extension instead of mysql.

Shadow
  • 33,525
  • 10
  • 51
  • 64