Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Pixelairport's avatar

Decimal extension not loaded in php

I installed decimal on homestead. Load the package an put the extension into php.ini. Now when I write ...

php --re decimal

... i get ...

Extension [ <persistent> extension #16 decimal version 1.4.0 ] {

  - Classes [1] {
    Class [ <internal:decimal> final class Decimal\Decimal implements Stringable, JsonSerializable ] ...

But when I use Decimal\Decimal in Laravel on homestead I get this error: Class "Decimal\Decimal" not found (View: /home/vagrant/code/...

0 likes
6 replies
Pixelairport's avatar

Already checked it. But it was also not in the phpinfo. ... do you think i use wrong php.ini? I used the one in php8.1 because i configure the homestead.yaml to use 8.1 and also when i do php -v the terminal says i use 8.1.

I set it up on homestead in /etc/php/8.1/cli/php.ini

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@Pixelairport you only added it for cli. Check the path. There should be more than one ini file. Depends on what your webserver uses

1 like
Pixelairport's avatar

@Sinnbeck Ok... never saw that there were multiple php.ini files... and also phpinfo said that it was load from another directory... sorry. I did not see that. thx @sinnbeck

Pixelairport's avatar

mom... there is also a dir called cgi ... i test this :/

Please or to participate in this conversation.