Configuring PHP

Posted on 2005-04-12
Last Modified: 2013-12-15
Hi there.  I'm sure this is a pretty easy question, but here it is:

I'm updating my php from 4.3.10 to 4.3.11 and am going to try to do it manually.  I recently re ./configured php to add mbstring to make phpmyadmin happy so I have an idea how to do it but my question is as follows:

What should be included in the ./configure for my server?

I ran the phpinfo() command on my server and on a friend's server running an earlier version of php and here are the differences which spurred me to post this question.

My configuration parameters currently:
'./configure' '--with-mysql' '--with-apxs2=/usr/local/apache2/bin/apxs' '--prefix=/www' '--enable-module=so' '--enable-mbstring=all'

My buddy's:
'./configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2=/usr/sbin/apxs'

Now, as you can see he has a ton more enabled/configured.  Is all of that necessary?  My server is used primarily as a web server for a few web sites.  I mostly run php/mysql scripts.  Things appear to work with the current configuration I'm using, but what would the "experts" here suggest?  :)
Question by:source2k3
    LVL 4

    Accepted Solution

    Hi source2k3,

    No not all of this is necessary you should be fine with the version you are using, and you can easyly recompile
    when you need these options, But the sample of your buddy doesn't look like it is configured manualy but it looks like this is done by installing packages instead of compile the source yourself

    that why he has so many options defined

    Best regards,
    Danny Ebbers
    LVL 1

    Author Comment

    Which ones do you recommend?  

    It seems as though at least these would be good, no?
    --enable-magic-quotes --enable-safe-mode --enable-bcmath

    LVL 4

    Expert Comment


    It's hard to advise you on this one, safe-mode just makes sure some functions in php cannot be used or used restricted
    as long as nobody else is scripting on your server and your code is secure you don't have to worry to leave that off.

    It really depends on what you need and what you want.

    therefore if this is just a development version for yourself, you better off with minimum settings, and as soon as you
    explore functions that you did not include in your compilation, you should then enable them

    but for a lot of these options you will need optional libraries.

    so to make your life much easyer it's often easyer to use your distrobutions packaging system
    but if you insist in compiling yourself

    that will be oke, but you'll find when you have to recompile to enable some operations as soon as you need them


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now