The requested PHP extension ext-mysql * is missing from your system. in php 7.1.7

Viewed 14164

I am trying to deploy php app on heroku. I have added tables to clearDB but stuck on this part: after adding

"ext-mysql":"*" 

this line in composer. json it thows me error saying ERROR: Your 'composer.json' lists dependencies inside 'require', but no 'composer.lock' was found. Please run 'composer update' to re-generate 'composer.lock' if necessary, and commit it into your repository.

and after running

php composer.phar update

I get this error

The requested PHP extension ext-mysql * is missing from your system. Install or enable PHP's mysql extension.
3 Answers

You can add --ignore-platform-reqs

Full code:

php composer.phar update --ignore-platform-reqs

I hope this will help

http://php.net/manual/en/mysql.php

PHP 5 users can choose between the deprecated mysql extension, mysqli, or PDO_MySQL. PHP 7 removes the mysql extension, leaving only the latter two options.

sudo apt-get install php7.2-fpm php7.2-cli php7.2-mysql php7.2-gd php7.2-imagick php7.2-recode php7.2-tidy php7.2-xmlrpc php7.2-common php7.2-curl php7.2-mbstring php7.2-xml php7.2-bcmath php7.2-bz2 php7.2-intl php7.2-json php7.2-readline php7.2-zip

solve the question But I don't know why.

Related