Some PHP libs only work after reboot (mbstring, intl) on EC2

33 Views Asked by At

I'm trying to create a template for an instance to run my app, so I have the application package (zip), the HTTP server, all the infrastructure already mapped so I can launch a new instance whenever needed.

But one thing is keeping me from having a perfect set of steps to get it running: a couple of php libs will simply not be correctly installed, needing to be manuallt installed later, and not only that, they will not work unless I boot the instance. They are mbstring and intl.

This is how I am installing php:

sudo amazon-linux-extras enable php8.1
sudo yum install php-{dom,pcre,spl,simplexml,gd,ctype,soap,xmlrpc,tokenizer,openssl,iconv,pear,cgi,pdo,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip}
sudo amazon-linux-extras install -y php8.1

You can see mbstring and intl are there. But they will not work. So I have to do it like this: sudo yum install -y php-mbstring php-intl

It does install correctly. But restarting Apache won't get it working, I still get error messages complaining that the libs arent't there. After a reboot everything works.

Is there any other way to properly installing these guys without a reboot?

0

There are 0 best solutions below