Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 stackoverflow.com 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
    
okay...so 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

1 Answer 1

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: http://php.net/manual/en/faq.build.php

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

 
discard

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.