Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So MacPorts is the most painless way of installing stuff on my machine. But I want some custom options on my php5 install. How do I do this?

With a downloaded version of php, I would do this: ./php_folder/configure --with-config-file-scan-dir=/etc/php.d

With MacPorts I install it with this: sudo port install php5 +apache2 +mysql5 +pear

But I want to do something like this... sudo port install php5 +apache2 +mysql5 +pear --with-config-file-scan-dir=/etc/php.d

I just have no idea how to do it. Documentation says I can create a portfile but that looks a bit overkill for what I want to do.

share|improve this question

migrated from stackoverflow.com Jul 5 '11 at 14:52

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

2 Answers 2

You can try go to /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/ subfolder and open in pico or vim editor Portfile located in each product folder you want to install.

For example - /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/lang/php5/Portfile

In this file you should go to line with text configure.args and add configure options you need.

Hope it helps.

share|improve this answer

Customizing the Portfile is the right way to go, as suggested by Dmitry. But instead of messing with the official portfile synced from rsync.macports.org, it might be a better idea to create a local portfile repository and put the customized version of the portfile there.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.