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

I have changed some settings in various things on my site and I am being told i need to "recompile PHP" via ssh.

can anybody tell me how to do that?

OOF, harsh - people wanna shut this one real fast.

Heres the situation. I have some nice preg_matches going on throughout my site, but the server I am on is throwing up errors left and right, complaining about my PCRE not being UTF-8 friendly.

After researching the problem, it seems the only way to make it friendly is by recompiling PHP with a few flags in the conditions.

And that is where I'm at.

share|improve this question

migrated from Jan 21 '10 at 6:59

This question came from our site for professional and enthusiast programmers.

Recompiling PHP is almost always a last resort. You need to talk more in detail about your situation in order to get at what you really need. – Ignacio Vazquez-Abrams Jan 21 '10 at 6:47
thanks ignacio...good point...i edited my question:) – johnnietheblack Jan 21 '10 at 6:55
What OS? If it's a Linux distro, it's often easiest to start with the source package and modify it to add whatever extra options you need. – ZoogieZork Jan 21 '10 at 7:04 basically a fresh install? – johnnietheblack Jan 21 '10 at 7:06
Since you're modifying the source package for PHP, the result will be a new PHP package which you can use to install "over" your existing installation. This only works if PHP was originally installed via package, of course. – ZoogieZork Jan 21 '10 at 7:13
up vote 1 down vote accepted

Begin by figuring out how to connect to your server via ssh. Then use wget to download the latest php sources. cd into the directory with the unzipped files. Run configure with the options you want, then run make.

Here is the official FAQ:

share|improve this answer
Hmmm... better edit my post. The site is down. – Nathan Osman Jan 21 '10 at 7:09
There. A new working link! – Nathan Osman Jan 21 '10 at 7:16
thanks george:) sorry on the delay for checkin you as answer – johnnietheblack Jan 21 '10 at 17:35

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.