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

I'm having trouble getting php-gtk installed with php 5.3 on os x. I'm currently using macports to do it and when I try to install php-gtk, it spews 'duplicate static' errors:

Error: Target returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_php_php5-gtk/work/php-gtk-2.0.1" && /usr/bin/make -j2 all " returned error 2
Command output: ext/gtk+/gen_pango.c:2951: error: duplicate 'static'
ext/gtk+/gen_pango.c:2957: error: duplicate 'static'
ext/gtk+/gen_pango.c:3097: error: duplicate 'static'
ext/gtk+/gen_pango.c:3103: error: duplicate 'static'

Is there a way to coerce it into building, or an alternative way to install it?

share|improve this question
What's the exact MacPorts command you're running? – morgant Aug 4 '10 at 11:59
sudo port install php5-gtk – Shabbyrobe Aug 7 '10 at 7:40

php-gtk2 is not supported in php 5.3. The phpgtk homepage talks about how the next version will support version 5.3. On the down side, that post was posted almost two years ago. The latest post from 6 months ago says that it is still slowly being worked on.

I've posted instruction here on how you can set up gtk on php 5.2.17 using macports

share|improve this answer

What version do you have of :

  • PHP
  • Mac OS X
  • MacPorts

Maybe you should try this installer.

EDIT : installer link changed

share|improve this answer
Will the installer, which appears to install php 5.2.5 according to the screenshots in the link you provided, interfere with my current macports installation of php 5.3? – Shabbyrobe Aug 7 '10 at 7:39
Actually, the installer link doesn't appear to work. – Shabbyrobe Aug 7 '10 at 7:41
Link changed. The installer doesn't install PHP, it only installs the bindings for GTK. I download it and it installs everything in /usr/local/php-gtk, so it shouldn't interfere with MacPorts install which is in /opt – Studer Aug 7 '10 at 13:04
I have PHP 5.3.2 installed through macports 1.8.2 running on OS X 10.6.2 – Shabbyrobe Aug 9 '10 at 2:36
Try updating MacPorts to its latest version : 1.9.1 (at the time of writing) – Studer Aug 9 '10 at 10:50

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.