Score:0

mbstring (php/phalcon) - installed but not appearing in phpinfo()

fk flag

I tried to install mbstring to use Phalcon, I don't know what I'm doing wrong but it doesn't appear in phpinfo().

Here's is basically what I've used :

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2
sudo apt-get install php ; 8.2 here
sudo apt-get install php-mbstring

After that I edited the file /etc/php/8.2/apache2/php.ini (note that this is the one that appear in the "Loaded Configuration File" when using phpinfo()) to modify from :

; extension=mbstring

to

extension=mbstring

extension_dir is still commented. Also tried that :

extension=/usr/lib/php/20210902/mbstring.so

As find / -type f -name "mbstring.so" returns /usr/lib/php/20210902/mbstring.so

Then

sudo systemctl restart apache2

Once done there is still nothing about mbstring using phpinfo().

What I am doing wrong ?

I'm pretty sure this is only one step I missed. FYI :

root@localhost:/etc/php/8.2/mods-available# php -m | grep mbstring
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/lib/php/20220829/mbstring.so (/usr/lib/php/20220829/mbstring.so: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/mbstring.so.so (/usr/lib/php/20220829/mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

EDIT : Got the same issue for phalcon.so and php-xml so I really think I missed something...

EDIT2 : I'm trying to do the thing as they must be done, so don't hesitate to told me if something seems wrong.

David avatar
cn flag
You may be doing something very wrong but can not know for sure as you did not give the version of Ubuntu you are using?
Emma K avatar
fk flag
I am using Ubuntu 22.04
David avatar
cn flag
If you have installed Python 8.2 on a Ubuntu 22.04 OS machine you not longer have a working OS. Ubuntu needs the version of Python it ships with, the exact version. If you change the default a lot of the OS functions will no longer work. The wisest thing to do is a fresh new install of the OS and then learn about setting up multiple Python version on the OS and not replacing the default. Ubuntu 22.04 default is Python 10.
Emma K avatar
fk flag
I think there is a missunderstand here. I didn't touch Python, only PHP.
David avatar
cn flag
Great and yes I read that but a common next step is to mess with Python I should have made it clear it was a warning.
in flag
Ubuntu 22.04 has PHP 8.1 in the default repositories. Which source repos are you using for 8.2? Ondrej or something else? All of my projects use `mbstring` and I haven't had to mess around with `php.ini` for any system in years ...
Emma K avatar
fk flag
@matigo You're right ! Tried from 0 again and got PHP8.1 so I do think I was using Ondrej's repository as I wanted to use it to get PHP7.4. Still, used "apt-get install php-mbstring" but now I have doubt on how to link it to apache, as the mbstring section still missing. When I used "phpenmod mbstring" it worked ! Finally.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.