Configuring PHP

Posted on 2005-04-12
Medium Priority
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
  • 2

Accepted Solution

danny_ebbers earned 375 total points
ID: 13764692
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

Author Comment

ID: 13764742
Which ones do you recommend?  

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


Expert Comment

ID: 13764863

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


Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

850 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