Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

What are the steps needed to compile in support for syck into php 5.2.x on a 64 bit centos 5.3 system?

I haven't seen this another good FAQ on this, so I figured I would drop both the question and answer here since it took me a good while to figure out. If anyone appreciates, please upvote both Q & A so I know to keep posting things like this here.

share|improve this question
There is nothing wrong with asking and answering your own question. But it would be better if you actually try to phrase it so the 'question' is actually a question. ( – Zoredache Oct 28 '09 at 22:58
Thx, i just hadn't posted the answer yet, so it seemed kind of strange in the interim – Zak Oct 28 '09 at 23:00
up vote 1 down vote accepted

Notes: This was a 64 bit centos 5.3 box

So first I had to download source for both syck and php. I extracted them to ~/syck and ~/php5 respectively .

if you just try to configure php5 further adding in syck, you will see there is no configure option to add it in:

[z@abc php-5.2.6]# ./configure --help |grep syck
[z@abc php-5.2.6]#

next, I set up some compiling options

export CFLAGS="-fPIC -O3" this gives me level 3 optimization and a processor independent compile.

then build syck

[z@abc syck-0.53/ext/php]# ./configure --prefix=/usr/local/syck
[z@abc syck-0.53/ext/php]# make -j4
[z@abc syck-0.53/ext/php]# make check
[z@abc syck-0.53/ext/php]# make install

now I copy the php extension dir for syck over into php's ext area

cp -r ext/php ../{PHPSRCDIR}/ext/syck

Then I changedir back over to php (~/php5)

Now that syck is in php's ext dir, i can run buildconf and it will pick it up and put it into the configure options for php5

[z@abc php-5.2.6]#  ./buildconf --force

If you are interested to see what happens, you can run the buildconf without the --force, it won't hurt anything, but will fail to run

Now I get

[z@abc php-5.2.6]# ./configure --help |grep syck
--with-syck=DIR       Include syck support 
[z@abc php-5.2.6]#

So php will now let me add syck as a statically compiled module.. w000t!!


[z@abc php-5.2.6]# ./configure  '--prefix=/usr/local/php5' --with-syck=/usr/local/syck

Then it's make time!!!

[z@abc php-5.2.6]# make -j4
[z@abc php-5.2.6]# make test
[z@abc php-5.2.6]# make install

Done!! woot

To check my work:

[z@abc php-5.2.6]# /usr/local/php5/bin/php -m
[PHP Modules]
[z@abc php-5.2.6]#

yup php -m sees it as a module!

share|improve this answer

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.