Install Php Mbstring Extension Debian Server

  

Server Fault is a question and answer site for system and network administrators. How to install php-xml and php-mbstring on PHP 5.4.9-4? The following.

  1. Install Php Mbstring Extension Debian Server Installation
  2. Php Mbstring Extension Ubuntu
Active4 years, 3 months ago

I need to install on a lamp server exactly the same php extensions that are installed on an old server, how do to know exactly which extensions are installed in order to install the same on the new server?

Tuyoshi ViniciusTuyoshi Vinicius

3 Answers

You can use the command line switch -m to php to see what modules are installed.

You could also use php -i to get phpinfo(); output via the command line which would include this info as well.

References

slm

Install Php Mbstring Extension Debian Server Installation

Mbstring php extensionslm
268k74 gold badges581 silver badges728 bronze badges

If the extension is actually being used, it will need to be referenced in php.ini somewhere. Extensions are loaded in a pretty intuitive manner:

etc, etc.

One thing to watch out for are extensions that are brought in by an additional ini file being included. I'm not sure about Debian, but on RHEL there's a /etc/php.d/ directory where all .ini files are treated like as if they had been in the main /etc/php.ini

If it's not in one of those two places (main php.ini or one of the included files) then the extension is more or less just sitting on the filesystem not being used.

EDIT:

Actually, I think I lied. You may have to look at your php files for calls to dl(). I don't know of many people who load extensions like that, though. Not even sure what the use case would be but it's another area you should probably check.

Php Mbstring Extension Ubuntu

BratchleyBratchleyInstall Php Mbstring Extension Debian Server
12.5k7 gold badges48 silver badges92 bronze badges

In Debian, PHP extensions are loaded via files in /etc/php5/conf.d

There are two types of PHP Debian packages that might be installed here:

  • Debian PHP packages (which have names starting with php5- )
  • PECL PHP packages (which have names starting with php- )

To list both on your system, you can use this command: dpkg -l | grep 'ii php5?-' which lists installed packages starting with either php- or php5- .

You also might have extensions that were built with PECL from source code. List those with: pecl list

Finally, it's possible to compile your own extensions the old fashioned way. In that case they might not have a file in /etc/php5/conf.d but might be added to php.ini itself.

All extensions usually have a section of output from phpinfo();. php -m will show the list of what extensions PHP has loaded (each of which should have a spot in the phpinfo output). There will be many more extensions listed in the php -m output than are installed as add-on packages in Debian, because there are lots of default extensions built into PHP as well as the ones you can install afterwards.

Here is example output from a development machine listing extra installed PHP extensions:

Install Php Mbstring Extension Debian Server
Professor FalkenProfessor Falken

Not the answer you're looking for? Browse other questions tagged debianphp or ask your own question.