<p>The answer is in your error message. The PHP extension BCMath is required by Craft, per the <a href="https://craftcms.com/docs/4.x/requirements.html#required-php-extensions" rel="nofollow noreferrer">CraftCMS requirements docs</a>.</p>
<p>I.e.: Your server is not configured correctly.</p>

CC BY-SA 4.0
2024-02-29T11:22:32.543Z
2024-02-29T11:22:32.543Z
Seth Warburton
<p>There's tons of resources to get you up to speed on Composer, and a lot of the web uses it so this will help you out across different setups as well!</p>
<p>If you don't have composer on your hosting server, you will need to run all of the Composer work locally and make sure that you're uploading everything via your FTP. Be sure to upgrade Craft 3 before trying to upgrade to Craft 4, using the provided guides: <a href="https://craftcms.com/docs/3.x/upgrade.html" rel="nofollow noreferrer">https://craftcms.com/docs/3.x/upgrade.html</a></p>
<p>Its important not to skip any migration or project-config steps with this. Run <code>composer install</code> locally and <code>craft update</code> to ensure all of your libraries and dependencies are taken care of. Take note of any error output from running these, as they need to be addressed before uploading. You will need to ensure you're uploading the entire vendor folder to your server, as you've indicated that you aren't setup to use composer there.</p>
<p>For the specific error you posted - you need to update your server's PHP .ini file to allowe the bcmath extension, as one of the libraries requires it (referring to <code>Install or enable PHP's bcmath extension.</code>) As a heads up, this is Composer's job... telling you when something a library requires to work on your setup is missing or has a conflict. The error is not with composer's setup.</p>

CC BY-SA 4.0
2024-03-03T01:29:24.620Z
2024-03-03T01:29:24.620Z
cherrykoda
<p>I am upgrading from Craft 2 to Craft 4 and this is the first time I'm deploying a Craft 4 website. It was entirely unclear how to do this, as just uploading the files to an FTP server does not work because of Composer. My workaround was to just copy and paste all symlinked files to the vendor folder, however when I want to install a plugin on a production website I get the following error:</p>
<pre><code>Composer was unable to install the updates due to a dependency conflict.
Error: The command &quot;'php' '/var/www/vhosts/domainname.com/httpdocs/app/storage/runtime/composer.phar' 'update' 'craftcms/contact-form' '--with-all-dependencies' '--working-dir' '/var/www/vhosts/domainname.com/httpdocs/app' '--no-scripts' '--no-ansi' '--no-interaction'&quot; failed.
Exit Code: 2(Misuse of shell builtins)
Working directory: /var/www/vhosts/domainname.com/httpdocs

Error Output: ================ 

Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.
Problem 1 - craftcms/cms[4.4.8, ..., 4.8.x-dev] require ext-bcmath * -&gt; it is missing from your system. Install or enable PHP's bcmath extension. - Root composer.json requires craftcms/cms ^4.4.0 -&gt; satisfiable by craftcms/cms[4.4.0-beta.1, ..., 4.8.x-dev].
 You can also run php --ini in a terminal to see which files are used by PHP in CLI mode. Alternatively, you can run Composer with --ignore-platform-req=ext-bcmath to temporarily ignore these required extensions.
Composer output: Loading composer repositories with package information Updating dependencies
</code></pre>
<p>I have never used composer before this and I am completely lost. I have spend over 10 hours on this problem and haven't gotten a step closer. I figured out that with SSH I can access my FTP, but on there I can't install composer.</p>

<craft4><composer>
Unable to install plugins in Craft 4 production
# Unable to install plugins in Craft 4 production

(Asked by: username_0 on 2024-02-28)

I am upgrading from Craft 2 to Craft 4 and this is the first time I'm deploying a Craft 4 website. It was entirely unclear how to do this, as just uploading the files to an FTP server does not work because of Composer. My workaround was to just copy and paste all symlinked files to the vendor folder, however when I want to install a plugin on a production website I get the following error:
Composer was unable to install the updates due to a dependency conflict.
Error: The command "'php' '/var/www/vhosts/domainname.com/httpdocs/app/storage/runtime/composer.phar' 'update' 'craftcms/contact-form' '--with-all-dependencies' '--working-dir' '/var/www/vhosts/domainname.com/httpdocs/app' '--no-scripts' '--no-ansi' '--no-interaction'" failed.
Exit Code: 2(Misuse of shell builtins)
Working directory: /var/www/vhosts/domainname.com/httpdocs

Error Output: ================ 

Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.
Problem 1 - craftcms/cms[4.4.8, ..., 4.8.x-dev] require ext-bcmath * -> it is missing from your system. Install or enable PHP's bcmath extension. - Root composer.json requires craftcms/cms ^4.4.0 -> satisfiable by craftcms/cms[4.4.0-beta.1, ..., 4.8.x-dev].
 You can also run php --ini in a terminal to see which files are used by PHP in CLI mode. Alternatively, you can run Composer with --ignore-platform-req=ext-bcmath to temporarily ignore these required extensions.
Composer output: Loading composer repositories with package information Updating dependencies

I have never used composer before this and I am completely lost. I have spend over 10 hours on this problem and haven't gotten a step closer. I figured out that with SSH I can access my FTP, but on there I can't install composer.

**Tags:** craft4, composer

---

## 2 answers

### Answer by username_1 on 2024-02-29. Score: 2

The answer is in your error message. The PHP extension BCMath is required by Craft, per the [CraftCMS requirements docs](https://craftcms.com/docs/4.x/requirements.html#required-php-extensions).

I.e.: Your server is not configured correctly.


---

### Answer by username_2 on 2024-03-03. Score: 2

There's tons of resources to get you up to speed on Composer, and a lot of the web uses it so this will help you out across different setups as well!

If you don't have composer on your hosting server, you will need to run all of the Composer work locally and make sure that you're uploading everything via your FTP. Be sure to upgrade Craft 3 before trying to upgrade to Craft 4, using the provided guides: <https://craftcms.com/docs/3.x/upgrade.html>

Its important not to skip any migration or project-config steps with this. Run `composer install` locally and `craft update` to ensure all of your libraries and dependencies are taken care of. Take note of any error output from running these, as they need to be addressed before uploading. You will need to ensure you're uploading the entire vendor folder to your server, as you've indicated that you aren't setup to use composer there.

For the specific error you posted - you need to update your server's PHP .ini file to allowe the bcmath extension, as one of the libraries requires it (referring to `Install or enable PHP's bcmath extension.`) As a heads up, this is Composer's job... telling you when something a library requires to work on your setup is missing or has a conflict. The error is not with composer's setup.


---

