Report this

What is the reason for this report?

Installing php decimal entension for laravel app on DO app platform

Posted on September 6, 2023

I created a package that I use in a laravel application that requires ext-decimal to be installed on the machine.

I have ext-decimal in my composer.json file

{
  "require": {
      "php": "^8.1",
      "ext-decimal": "*",
      ...
   }
}

I get this error when I deploy it

incloud/decimal v1.0.6 requires ext-decimal * -> could not be found in any version, there may be a typo in the package name.

I’m not using Dockerfile only composer.json

How can I get ext-decimal installed on the app platform?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

I think that the problem might be that the ext-decimal is only supported for PHP 7, at least according to this open issue on their official repository here:

https://github.com/php-decimal/ext-decimal/issues/43

It looks like the extension has not been updated in a while, the last commits made to that repository were 3-4 years ago.

Is your local development environment using PHP 8.1 together with ext-decimal?

As the extension has not been maintained lately, it might be best to use an alternative extension or a native PHP function in your package as it might become a problem in the future for other platforms as well.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.