Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Please bear with me; I'm a developer, not a server admin. My company wants to explore using Magento. They've handed me a pre-configured Linux server with apache and PHP installed, but when I try to run the Magento setup, it tells me that there are PHP extensions that need to be loaded. I can edit the php.ini file, but have no idea where to get the extensions or how to install them, and there's no one here who knows, either.

Can anyone give me a hand? I need the PDO_MySQL, mcrypt, and GD extensions. I've searched and found sites that talk about downloading from the terminal and compiling code, but it's all way over my head. Is there an easy way to do this?

share|improve this question

migrated from Oct 10 '12 at 1:59

This question came from our site for pro webmasters.

up vote 2 down vote accepted

Have a look at

Often Linux system have the pear application in repository, so you would just need to run a command for each extension you'd like to install.

share|improve this answer

It might help to know what distro you are running, and what version of php. I'm talking about the process of finding packages as well since its better to know how to find stuff than just install what you're told. Teach an man to fish and all that.

Now, I have ubuntu and centos boxen on hand, and through the magic of the package search command....

For Ubuntu

I used apt-cache search KEYWORD php to find the packages in question - in this case the name of the plugin as the keywords. From that, you can install the 3 packages you need through apt-get install php5-mcrypt php5-gd php5-mysql - the last package should cover PDO on debian like distros I believe

For Centos/Red Hat

I used yum search KEYWORDS the same way - but not all the packages you need seem available by default.

The packages you're interested in are php-pdo php-gd and php-mcrypt - the last is not in the default repository (I checked on yum, then googled)- you may need to add the EPEL repository to get that package instead

Using the default package manager should result in easier to install and maintain packages, since your updates will happen with everything else.

share|improve this answer
I did figure out how to get them installed - the server is running ubuntu, so I googled for apt-get and the extension name to find the actual command. I didn't know about apt-cache search; will definitely add that to my sticky notes of things to remember. – EmmyS Oct 11 '12 at 16:34
I think the more important lesson here is give essential information - I'd have had an easier time If i didn't have to whip out the centos box I had sitting in a corner to try this. OS version counts as utterly essential information. – Journeyman Geek Oct 12 '12 at 0:44
I appreciate your answer, but no one forced you to "whip out your centos box". If I didn't provide enough info, you could have just asked in a comment. – EmmyS Oct 13 '12 at 1:06
Well, I did overstate the difficulty of it - I had the system running anyway cause I'm learning the RH way of doing things, and I'm not familiar with YUM. I still think you might have wanted to mention what distro/version you had as its essential for folk to answer your question. – Journeyman Geek Oct 13 '12 at 1:11

You may want to review This has all of the necessary commands and trouble shooting.

share|improve this answer
Welcome to Serverfault! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Scott Pack Oct 10 '12 at 15:54

To update the PHP Extension in Linux:

Step 1: Login as a root

step2: type--> Yum install php-xml

step3:service httpd restart // restart the service

share|improve this answer
You should invest some time into reading the question. php-xml isn't mentioned there, and by no means yum works on all distributions. Same for restarting services. – Deer Hunter Oct 17 '14 at 10:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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