Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 823563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:58:00+00:00 2026-05-15T02:58:00+00:00

I have heard that setting the –prefix=PREFIX option when compiling PHP on linux will

  • 0

I have heard that setting the --prefix=PREFIX option when compiling PHP on linux will allow you to have more than one install of PHP at a time without them clashing. (I think the default if this isn’t set is /usr/local). However, I’m not sure what exactly it does or what a good setting to use is. Furthermore, I’ve also heard that setting it to something other than the default value might make some PHP extensions harder to install.

./configure --prefix=PREFIX ...

I just realized that some of the other options such as --exec-prefix might still need to be set to /usr/local since they default to the value of --prefix. This would cause problems if prefix was set to something like web/phpalt because things like the --sbindir is set to “–exec-prefix + /sbin`.

Directory and file names:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [same as prefix]
  --bindir=DIR            user executables in DIR [EPREFIX/bin]
  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
                          [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  --infodir=DIR           info documentation in DIR [PREFIX/info]
  --mandir=DIR            man documentation in DIR [PREFIX/man]
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
  --program-prefix=PREFIX prepend PREFIX to installed program names
  --program-suffix=SUFFIX append SUFFIX to installed program names
  --program-transform-name=PROGRAM
                          run sed PROGRAM on installed program names

Based on what PHP is saying then it seems like you could set the following options without any side affects.

./configure --prefix=/custom/path --exec-prefix=/usr/local

However, this is just a guess.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:58:00+00:00Added an answer on May 15, 2026 at 2:58 am

    If you want to switch between 5.2 and 5.3, you’re probably better off compiling both Apache and PHP from source, into special directories.

    Basically, you could compile apache and php5.2 to some place like /web/php52 (giving –prefix=/web/php52 to configure for both apache and php. Then do the same for apache/php53 with a prefix like /web/php53

    You could even get tricky and do things like symlink various configs between the two apache installations to keep things consistent (so the only difference is that one is running 5.3 and the other 5.2)

    Then when you want to start up your 5.2 server, you just say:

    $ /web/php52/bin/apachectl start
    

    and then to switch over to 5.3

    $ /web/php52/bin/apachectl stop
    $ /web/php53/bin/apachectl start
    

    I have some (old) build scripts available that may or may not save you some pain if you’re compiling on linux (CentOS in particular, but you could make it work pretty easily on non-redhat distros, too)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 411k
  • Answers 411k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer No, you can not use in app purchase for this… May 15, 2026 at 7:47 am
  • Editorial Team
    Editorial Team added an answer I figured it out... I simplified the code for the… May 15, 2026 at 7:47 am
  • Editorial Team
    Editorial Team added an answer The best solution would be to use a List<string>. May 15, 2026 at 7:47 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.