There are a lot of questions about how to get extension X for PHP Version Y on Linux Distro Z running.

What I'm missing out there are comprehensive general tutorials about how PHP on Linux works.

As an example: I am currently trying to get mysqli working and I know I can either compile PHP with mysqli or include the extension. Well yeah, but how do I exactly compile PHP with a certain extension, where do I get the necessary files for my Linux Distro and if I want to include it as extension.so, where do I get this? Also if I look at my phpInfo() I see that PHP 5.2.14 is running but if I do yum info php, it tells me that the version is PHP 5.1.6. How come, do I have two differen PHP versions running, what would I do to get clarity into this... etc.

What I need is a clear description of the general mechanisms, something like a tutorial called: How to enable PHP extensions on Linux servers.

Any part-tutorials or links to such things are greatly appreciated!

link|improve this question

80% accept rate
Edit: PHP 5 of course, not 3. – markus Nov 14 '10 at 7:17
@Zoredache: centos-5.5-x86_64 – markus Nov 14 '10 at 7:20
But I'm really rather looking for general advice. – markus Nov 14 '10 at 7:21
feedback

1 Answer

With recent distros almost every standard PHP module is available as a package that you can just install. For non-standard modules if you have all the appropriate libraries available you should be able to build the module without rebuilding PHP.

I see that PHP 5.2.14 is running but if I do yum info php, it tells me that the version is PHP 5.1.6. How come, do I have two differen PHP versions running,

It is likely that you or someone installed the system and it came with PHP 5.1.6, and then they build a newer version from source, but they didn't remove the packaged version, confusing your package manager and making a bit of a mess.

link|improve this answer
Thanks for the answer, I meant PHP 5 all along but the problem remains the same. Sorry for the confusion. How can I clean up the 5.1.6 parts... – markus Nov 14 '10 at 7:19
feedback

Your Answer

 
or
required, but never shown

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