How do I tell Apache which PHP to use?Apache - change php versionPHP not being parsed in apache2, php module is installed and enabledConfiguring PHP for existing MySQL installationPHP 5.3.2 Upgrade on Windowsapache eats up too much ram per childHow To Change What Version of PHP Apache2 Uses?How can I tell which config file Apache is using?I've just installed php on CentOS but need to integrate with ApacheUpgrading from php 5.3 to php 5.4 with Macportphpinfo.php is not showing extra folder for additional PHP configuration filesCompiled a PHP, how do I load it in Apache?

Is my company merging branches wrong?

Requirement for splicing neutrals in a switch

Is presenting a play showing Military characters in a bad light a crime in the US?

What Species of Trees are These?

Ribbon Cable Cross Talk - Is there a fix after the fact?

Rotate and duplicate row values in Google Sheets

How can I use 400 ASA film in a Leica IIIf, which does not have options higher than 100?

Warped chessboard

What should I wear to go and sign an employment contract?

How do we properly manage transitions within a descriptive section?

How could Dwarves prevent sand from filling up their settlements

How would a physicist explain this starship engine?

Circuit construction for execution of conditional statements using least significant bit

Was Tyrion always a poor strategist?

Reverse Array, Let Elements in New Array Equal Length of Original Array Elements - JavaScript

Is there a way to generate a mapping graph like this?

Is there a realtime, uncut video of Saturn V ignition through tower clear?

1950s or earlier book with electrical currents living on Pluto

pwaS eht tirsf dna tasl setterl fo hace dorw

why "American-born", not "America-born"?

How to tease a romance without a cat and mouse chase?

Why use nominative in Coniugatio periphrastica passiva?

How does the +1 Keen Composite Longbow (+2 Str) work?

What to call a small, open stone or cement reservoir that supplies fresh water from a spring or other natural source?



How do I tell Apache which PHP to use?


Apache - change php versionPHP not being parsed in apache2, php module is installed and enabledConfiguring PHP for existing MySQL installationPHP 5.3.2 Upgrade on Windowsapache eats up too much ram per childHow To Change What Version of PHP Apache2 Uses?How can I tell which config file Apache is using?I've just installed php on CentOS but need to integrate with ApacheUpgrading from php 5.3 to php 5.4 with Macportphpinfo.php is not showing extra folder for additional PHP configuration filesCompiled a PHP, how do I load it in Apache?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








34















I am running Apache2 on a Mac OS X (10.5). I just compiled PHP 5.2.8 and finally got pdo-mysql working (or so I think).



This terminal command:



php --version


is showing 5.2.8 and I have the right modules installed.



But, when I do a phpinfo(), Apache dumps out PHP 5.2.6 (my earlier version, without pdo_mysql).



How do I tell Apache which PHP to load? The httpd.conf has the line:



LoadModule php5_module libexec/apache2/libphp5.so


But, I don't know what or where that is.



Is that what I have to change?










share|improve this question















migrated from stackoverflow.com Sep 16 '12 at 1:41


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


















  • When you compiled php did you use make install? If you did find the path that it installed your module to and change your apache config to point to it. Mac has it's own version of apache and php5 already installed which is why you are seeing a different version.

    – Ruggs
    Dec 23 '08 at 3:25






  • 1





    See OSX Apache using wrong version of PHP

    – Mick
    Mar 3 '14 at 13:12











  • Homebrew users, see @Mick comment

    – BatteryAcid
    Dec 8 '15 at 17:44







  • 1





    Did you solve your problem? ALL the answers are just mad thing

    – Pmpr
    Mar 3 '17 at 14:29











  • None of these responses answer the question. This is bizarre...

    – quant
    Dec 28 '18 at 9:02

















34















I am running Apache2 on a Mac OS X (10.5). I just compiled PHP 5.2.8 and finally got pdo-mysql working (or so I think).



This terminal command:



php --version


is showing 5.2.8 and I have the right modules installed.



But, when I do a phpinfo(), Apache dumps out PHP 5.2.6 (my earlier version, without pdo_mysql).



How do I tell Apache which PHP to load? The httpd.conf has the line:



LoadModule php5_module libexec/apache2/libphp5.so


But, I don't know what or where that is.



Is that what I have to change?










share|improve this question















migrated from stackoverflow.com Sep 16 '12 at 1:41


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


















  • When you compiled php did you use make install? If you did find the path that it installed your module to and change your apache config to point to it. Mac has it's own version of apache and php5 already installed which is why you are seeing a different version.

    – Ruggs
    Dec 23 '08 at 3:25






  • 1





    See OSX Apache using wrong version of PHP

    – Mick
    Mar 3 '14 at 13:12











  • Homebrew users, see @Mick comment

    – BatteryAcid
    Dec 8 '15 at 17:44







  • 1





    Did you solve your problem? ALL the answers are just mad thing

    – Pmpr
    Mar 3 '17 at 14:29











  • None of these responses answer the question. This is bizarre...

    – quant
    Dec 28 '18 at 9:02













34












34








34


6






I am running Apache2 on a Mac OS X (10.5). I just compiled PHP 5.2.8 and finally got pdo-mysql working (or so I think).



This terminal command:



php --version


is showing 5.2.8 and I have the right modules installed.



But, when I do a phpinfo(), Apache dumps out PHP 5.2.6 (my earlier version, without pdo_mysql).



How do I tell Apache which PHP to load? The httpd.conf has the line:



LoadModule php5_module libexec/apache2/libphp5.so


But, I don't know what or where that is.



Is that what I have to change?










share|improve this question
















I am running Apache2 on a Mac OS X (10.5). I just compiled PHP 5.2.8 and finally got pdo-mysql working (or so I think).



This terminal command:



php --version


is showing 5.2.8 and I have the right modules installed.



But, when I do a phpinfo(), Apache dumps out PHP 5.2.6 (my earlier version, without pdo_mysql).



How do I tell Apache which PHP to load? The httpd.conf has the line:



LoadModule php5_module libexec/apache2/libphp5.so


But, I don't know what or where that is.



Is that what I have to change?







php apache-2.2 pdo






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 3 '17 at 15:22









Pmpr

1096




1096










asked Dec 23 '08 at 2:15









Sam McAfeeSam McAfee

293147




293147




migrated from stackoverflow.com Sep 16 '12 at 1:41


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









migrated from stackoverflow.com Sep 16 '12 at 1:41


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














  • When you compiled php did you use make install? If you did find the path that it installed your module to and change your apache config to point to it. Mac has it's own version of apache and php5 already installed which is why you are seeing a different version.

    – Ruggs
    Dec 23 '08 at 3:25






  • 1





    See OSX Apache using wrong version of PHP

    – Mick
    Mar 3 '14 at 13:12











  • Homebrew users, see @Mick comment

    – BatteryAcid
    Dec 8 '15 at 17:44







  • 1





    Did you solve your problem? ALL the answers are just mad thing

    – Pmpr
    Mar 3 '17 at 14:29











  • None of these responses answer the question. This is bizarre...

    – quant
    Dec 28 '18 at 9:02

















  • When you compiled php did you use make install? If you did find the path that it installed your module to and change your apache config to point to it. Mac has it's own version of apache and php5 already installed which is why you are seeing a different version.

    – Ruggs
    Dec 23 '08 at 3:25






  • 1





    See OSX Apache using wrong version of PHP

    – Mick
    Mar 3 '14 at 13:12











  • Homebrew users, see @Mick comment

    – BatteryAcid
    Dec 8 '15 at 17:44







  • 1





    Did you solve your problem? ALL the answers are just mad thing

    – Pmpr
    Mar 3 '17 at 14:29











  • None of these responses answer the question. This is bizarre...

    – quant
    Dec 28 '18 at 9:02
















When you compiled php did you use make install? If you did find the path that it installed your module to and change your apache config to point to it. Mac has it's own version of apache and php5 already installed which is why you are seeing a different version.

– Ruggs
Dec 23 '08 at 3:25





When you compiled php did you use make install? If you did find the path that it installed your module to and change your apache config to point to it. Mac has it's own version of apache and php5 already installed which is why you are seeing a different version.

– Ruggs
Dec 23 '08 at 3:25




1




1





See OSX Apache using wrong version of PHP

– Mick
Mar 3 '14 at 13:12





See OSX Apache using wrong version of PHP

– Mick
Mar 3 '14 at 13:12













Homebrew users, see @Mick comment

– BatteryAcid
Dec 8 '15 at 17:44






Homebrew users, see @Mick comment

– BatteryAcid
Dec 8 '15 at 17:44





1




1





Did you solve your problem? ALL the answers are just mad thing

– Pmpr
Mar 3 '17 at 14:29





Did you solve your problem? ALL the answers are just mad thing

– Pmpr
Mar 3 '17 at 14:29













None of these responses answer the question. This is bizarre...

– quant
Dec 28 '18 at 9:02





None of these responses answer the question. This is bizarre...

– quant
Dec 28 '18 at 9:02










5 Answers
5






active

oldest

votes


















14














I think all these answers aren't really answering the question. The root level can be determined by running the command httpd -V. This will show you what options the Apache daemon was built with at compile time. This is what controls where httpd determines where to look for it's config. files and .so modules by default.



For example:



% httpd -V
Server version: Apache/2.2.17 (Unix)
Server built: Dec 17 2010 11:58:24
Server's Module Magic Number: 20051115:25
Server loaded: APR 1.3.12, APR-Util 1.3.9
Compiled using: APR 1.3.12, APR-Util 1.3.9
Architecture: 32-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"


The key line in that output is the HTTPD_ROOT. That defines where Apache's ROOT directory is to start, /etc/httpd in my case, when looking for config. files and modules.



NOTE: This ROOT is not the same thing as DocumentRoot. This ROOT is specific to how the httpd daemon was compiled, the DocumentRoot is for specifying where the httpd daemon should start looking for actual web content (.html files and such).



For my httpd.conf file I have the following Load lines:



LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so


Given this the full path to your modules would be, for example:



/etc/httpd/modules/mod_auth_basic.so


This is from a CentOS 5.x system but the technique is still apt.



BTW, it can get a little confusing because in CentOS' case the files are organized physically here:



% ls /usr/lib/httpd/modules/
libphp5.so mod_authnz_ldap.so mod_dav_fs.so mod_headers.so mod_perl.so mod_speling.so


...and then accessible to the Apache daemon, httpd, through this path:



% ls -l /etc/httpd/
total 12
drwxr-xr-x 2 root root 4096 Apr 26 2011 conf
drwxr-xr-x 3 root root 4096 Apr 26 2011 conf.d
-rw-r--r-- 1 root root 18 Feb 24 2009 htpasswd
lrwxrwxrwx 1 root root 19 Apr 26 2011 logs -> ../../var/log/httpd
lrwxrwxrwx 1 root root 27 Apr 26 2011 modules -> ../../usr/lib/httpd/modules
lrwxrwxrwx 1 root root 13 Apr 26 2011 run -> ../../var/run


The modules link connects /etc/httpd --> /usr/lib/httpd/modules.






share|improve this answer

























  • slm as i stated in the previous post, the ServerRoot is defined in the ServerRoot directive and has nothing whatsoever to do with HTTPD_ROOT which is displayed via "httpd -V." Please consult Apache's web pages referenced in my previous post, or if you'd like change the ServerRoot directive in your httpd.conf file and see for yourself.

    – billynoah
    Jan 18 '13 at 8:45












  • ServerRoot is a way to overrride HTTPD_ROOT. HTTPD_ROOT is set at compile time via the --prefix configure switch. Your post was distinguishing the different b/w ServerRoot and DocumentRoot. httpd.apache.org/docs/current/mod/core.html#serverroot. Good to see you registered a name with your SF account!

    – slm
    Jan 18 '13 at 13:07











  • Does this really answer the question: "How do I tell Apache which PHP to use?" ?

    – Pmpr
    Mar 3 '17 at 14:20











  • Trix the OP accepted it so yes.

    – slm
    Mar 3 '17 at 14:35











  • @slm This does not answer the question.

    – quant
    Dec 28 '18 at 9:01


















4














You can find files on your system with the locate command:




# locate libphp5.so


It will print the full paths of all files with that name. I have one at /usr/libexec/apache2/libphp5.so.






share|improve this answer


















  • 1





    So what? is this an answer to the question? Or a way to find a file?

    – Pmpr
    Mar 3 '17 at 14:27






  • 1





    @Trix, the asker said, "I don't know what or where that is." I've shown how to find where that is. I assumed that once the asker saw all the other locations of the named file in question, it would be apparent how to change the setting to use a different one.

    – Rob Kennedy
    Mar 3 '17 at 14:50


















4














The parent directory of modules loaded in httpd.conf (such as: libexec/apache2/libphp5.so) is defined by the ServerRoot directive which by default is typically set to /usr. I wouldn't recommend changing this but it may be useful for someone to know just where exactly that path is defined.



Apache's website says the following about ServerRoot:




Relative paths in other configuration directives (such as Include or
LoadModule, for example) are taken as relative to this directory.




additionally the default httpd.conf file comments read:



ServerRoot: The top of the directory tree under which the server's configuration, error, and log files are kept.






share|improve this answer




















  • 1





    The OP is not after a definition to ServerRoot. Instead (s)he has asked the question "How do I tell Apache which PHP to use?". If you really want to answer it, so answer it

    – Pmpr
    Mar 3 '17 at 14:22


















3














Apache should be looking for modules in "/usr/libexec/httpd/". In there you'll find either a file or symlink called "libphp5.so". If it's a symlink, you'll need to relink to the new 5.2.8 libphp5.so, otherwise just copy the 5.2.8 libphp5.so to "/usr/libexec/httpd/" and restart apache with "sudo apachectl restart".






share|improve this answer






























    0














    I had a Apache and PHP installed on one of the server. This was installed by the previous sys admin. Both the Apache and PHP was complied from the source. In addition to this there was a default PHP installed. So to know which PHP is used by the Apache. I run the below command



     <Install Dir of PHP>/bin/php -i | grep apxs


    This gave me the path to apache apxs



     APACHE_HOME/bin/apxs


    This gave me info on which Apache is being used by this php. The default php gave error when i typed



    #php -i | grep apxs 

    Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory PHP Warning: PHP Startup: Unable to load dynamic library '<PHP_HOME>/lib/php/extensions/debug-non-zts-20121212/memcached.so' - <PHP_HOME>/lib/php/extensions/debug-non-zts-20121212/memcached.so: undefined symbol: OnUpdateLongGEZero in Unknown on line 0


    So in this way i was able to figure out the php used by Apache.






    share|improve this answer


















    • 1





      Please don't post the same answer twice. Instead, link to the first answer.

      – Sven
      Mar 27 '15 at 22:40











    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "2"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f428800%2fhow-do-i-tell-apache-which-php-to-use%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    5 Answers
    5






    active

    oldest

    votes








    5 Answers
    5






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    14














    I think all these answers aren't really answering the question. The root level can be determined by running the command httpd -V. This will show you what options the Apache daemon was built with at compile time. This is what controls where httpd determines where to look for it's config. files and .so modules by default.



    For example:



    % httpd -V
    Server version: Apache/2.2.17 (Unix)
    Server built: Dec 17 2010 11:58:24
    Server's Module Magic Number: 20051115:25
    Server loaded: APR 1.3.12, APR-Util 1.3.9
    Compiled using: APR 1.3.12, APR-Util 1.3.9
    Architecture: 32-bit
    Server MPM: Prefork
    threaded: no
    forked: yes (variable process count)
    Server compiled with....
    -D APACHE_MPM_DIR="server/mpm/prefork"
    -D APR_HAS_SENDFILE
    -D APR_HAS_MMAP
    -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
    -D APR_USE_SYSVSEM_SERIALIZE
    -D APR_USE_PTHREAD_SERIALIZE
    -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
    -D APR_HAS_OTHER_CHILD
    -D AP_HAVE_RELIABLE_PIPED_LOGS
    -D DYNAMIC_MODULE_LIMIT=128
    -D HTTPD_ROOT="/etc/httpd"
    -D SUEXEC_BIN="/usr/sbin/suexec"
    -D DEFAULT_PIDLOG="logs/httpd.pid"
    -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
    -D DEFAULT_LOCKFILE="logs/accept.lock"
    -D DEFAULT_ERRORLOG="logs/error_log"
    -D AP_TYPES_CONFIG_FILE="conf/mime.types"
    -D SERVER_CONFIG_FILE="conf/httpd.conf"


    The key line in that output is the HTTPD_ROOT. That defines where Apache's ROOT directory is to start, /etc/httpd in my case, when looking for config. files and modules.



    NOTE: This ROOT is not the same thing as DocumentRoot. This ROOT is specific to how the httpd daemon was compiled, the DocumentRoot is for specifying where the httpd daemon should start looking for actual web content (.html files and such).



    For my httpd.conf file I have the following Load lines:



    LoadModule auth_basic_module modules/mod_auth_basic.so
    LoadModule auth_digest_module modules/mod_auth_digest.so
    LoadModule authn_file_module modules/mod_authn_file.so


    Given this the full path to your modules would be, for example:



    /etc/httpd/modules/mod_auth_basic.so


    This is from a CentOS 5.x system but the technique is still apt.



    BTW, it can get a little confusing because in CentOS' case the files are organized physically here:



    % ls /usr/lib/httpd/modules/
    libphp5.so mod_authnz_ldap.so mod_dav_fs.so mod_headers.so mod_perl.so mod_speling.so


    ...and then accessible to the Apache daemon, httpd, through this path:



    % ls -l /etc/httpd/
    total 12
    drwxr-xr-x 2 root root 4096 Apr 26 2011 conf
    drwxr-xr-x 3 root root 4096 Apr 26 2011 conf.d
    -rw-r--r-- 1 root root 18 Feb 24 2009 htpasswd
    lrwxrwxrwx 1 root root 19 Apr 26 2011 logs -> ../../var/log/httpd
    lrwxrwxrwx 1 root root 27 Apr 26 2011 modules -> ../../usr/lib/httpd/modules
    lrwxrwxrwx 1 root root 13 Apr 26 2011 run -> ../../var/run


    The modules link connects /etc/httpd --> /usr/lib/httpd/modules.






    share|improve this answer

























    • slm as i stated in the previous post, the ServerRoot is defined in the ServerRoot directive and has nothing whatsoever to do with HTTPD_ROOT which is displayed via "httpd -V." Please consult Apache's web pages referenced in my previous post, or if you'd like change the ServerRoot directive in your httpd.conf file and see for yourself.

      – billynoah
      Jan 18 '13 at 8:45












    • ServerRoot is a way to overrride HTTPD_ROOT. HTTPD_ROOT is set at compile time via the --prefix configure switch. Your post was distinguishing the different b/w ServerRoot and DocumentRoot. httpd.apache.org/docs/current/mod/core.html#serverroot. Good to see you registered a name with your SF account!

      – slm
      Jan 18 '13 at 13:07











    • Does this really answer the question: "How do I tell Apache which PHP to use?" ?

      – Pmpr
      Mar 3 '17 at 14:20











    • Trix the OP accepted it so yes.

      – slm
      Mar 3 '17 at 14:35











    • @slm This does not answer the question.

      – quant
      Dec 28 '18 at 9:01















    14














    I think all these answers aren't really answering the question. The root level can be determined by running the command httpd -V. This will show you what options the Apache daemon was built with at compile time. This is what controls where httpd determines where to look for it's config. files and .so modules by default.



    For example:



    % httpd -V
    Server version: Apache/2.2.17 (Unix)
    Server built: Dec 17 2010 11:58:24
    Server's Module Magic Number: 20051115:25
    Server loaded: APR 1.3.12, APR-Util 1.3.9
    Compiled using: APR 1.3.12, APR-Util 1.3.9
    Architecture: 32-bit
    Server MPM: Prefork
    threaded: no
    forked: yes (variable process count)
    Server compiled with....
    -D APACHE_MPM_DIR="server/mpm/prefork"
    -D APR_HAS_SENDFILE
    -D APR_HAS_MMAP
    -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
    -D APR_USE_SYSVSEM_SERIALIZE
    -D APR_USE_PTHREAD_SERIALIZE
    -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
    -D APR_HAS_OTHER_CHILD
    -D AP_HAVE_RELIABLE_PIPED_LOGS
    -D DYNAMIC_MODULE_LIMIT=128
    -D HTTPD_ROOT="/etc/httpd"
    -D SUEXEC_BIN="/usr/sbin/suexec"
    -D DEFAULT_PIDLOG="logs/httpd.pid"
    -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
    -D DEFAULT_LOCKFILE="logs/accept.lock"
    -D DEFAULT_ERRORLOG="logs/error_log"
    -D AP_TYPES_CONFIG_FILE="conf/mime.types"
    -D SERVER_CONFIG_FILE="conf/httpd.conf"


    The key line in that output is the HTTPD_ROOT. That defines where Apache's ROOT directory is to start, /etc/httpd in my case, when looking for config. files and modules.



    NOTE: This ROOT is not the same thing as DocumentRoot. This ROOT is specific to how the httpd daemon was compiled, the DocumentRoot is for specifying where the httpd daemon should start looking for actual web content (.html files and such).



    For my httpd.conf file I have the following Load lines:



    LoadModule auth_basic_module modules/mod_auth_basic.so
    LoadModule auth_digest_module modules/mod_auth_digest.so
    LoadModule authn_file_module modules/mod_authn_file.so


    Given this the full path to your modules would be, for example:



    /etc/httpd/modules/mod_auth_basic.so


    This is from a CentOS 5.x system but the technique is still apt.



    BTW, it can get a little confusing because in CentOS' case the files are organized physically here:



    % ls /usr/lib/httpd/modules/
    libphp5.so mod_authnz_ldap.so mod_dav_fs.so mod_headers.so mod_perl.so mod_speling.so


    ...and then accessible to the Apache daemon, httpd, through this path:



    % ls -l /etc/httpd/
    total 12
    drwxr-xr-x 2 root root 4096 Apr 26 2011 conf
    drwxr-xr-x 3 root root 4096 Apr 26 2011 conf.d
    -rw-r--r-- 1 root root 18 Feb 24 2009 htpasswd
    lrwxrwxrwx 1 root root 19 Apr 26 2011 logs -> ../../var/log/httpd
    lrwxrwxrwx 1 root root 27 Apr 26 2011 modules -> ../../usr/lib/httpd/modules
    lrwxrwxrwx 1 root root 13 Apr 26 2011 run -> ../../var/run


    The modules link connects /etc/httpd --> /usr/lib/httpd/modules.






    share|improve this answer

























    • slm as i stated in the previous post, the ServerRoot is defined in the ServerRoot directive and has nothing whatsoever to do with HTTPD_ROOT which is displayed via "httpd -V." Please consult Apache's web pages referenced in my previous post, or if you'd like change the ServerRoot directive in your httpd.conf file and see for yourself.

      – billynoah
      Jan 18 '13 at 8:45












    • ServerRoot is a way to overrride HTTPD_ROOT. HTTPD_ROOT is set at compile time via the --prefix configure switch. Your post was distinguishing the different b/w ServerRoot and DocumentRoot. httpd.apache.org/docs/current/mod/core.html#serverroot. Good to see you registered a name with your SF account!

      – slm
      Jan 18 '13 at 13:07











    • Does this really answer the question: "How do I tell Apache which PHP to use?" ?

      – Pmpr
      Mar 3 '17 at 14:20











    • Trix the OP accepted it so yes.

      – slm
      Mar 3 '17 at 14:35











    • @slm This does not answer the question.

      – quant
      Dec 28 '18 at 9:01













    14












    14








    14







    I think all these answers aren't really answering the question. The root level can be determined by running the command httpd -V. This will show you what options the Apache daemon was built with at compile time. This is what controls where httpd determines where to look for it's config. files and .so modules by default.



    For example:



    % httpd -V
    Server version: Apache/2.2.17 (Unix)
    Server built: Dec 17 2010 11:58:24
    Server's Module Magic Number: 20051115:25
    Server loaded: APR 1.3.12, APR-Util 1.3.9
    Compiled using: APR 1.3.12, APR-Util 1.3.9
    Architecture: 32-bit
    Server MPM: Prefork
    threaded: no
    forked: yes (variable process count)
    Server compiled with....
    -D APACHE_MPM_DIR="server/mpm/prefork"
    -D APR_HAS_SENDFILE
    -D APR_HAS_MMAP
    -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
    -D APR_USE_SYSVSEM_SERIALIZE
    -D APR_USE_PTHREAD_SERIALIZE
    -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
    -D APR_HAS_OTHER_CHILD
    -D AP_HAVE_RELIABLE_PIPED_LOGS
    -D DYNAMIC_MODULE_LIMIT=128
    -D HTTPD_ROOT="/etc/httpd"
    -D SUEXEC_BIN="/usr/sbin/suexec"
    -D DEFAULT_PIDLOG="logs/httpd.pid"
    -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
    -D DEFAULT_LOCKFILE="logs/accept.lock"
    -D DEFAULT_ERRORLOG="logs/error_log"
    -D AP_TYPES_CONFIG_FILE="conf/mime.types"
    -D SERVER_CONFIG_FILE="conf/httpd.conf"


    The key line in that output is the HTTPD_ROOT. That defines where Apache's ROOT directory is to start, /etc/httpd in my case, when looking for config. files and modules.



    NOTE: This ROOT is not the same thing as DocumentRoot. This ROOT is specific to how the httpd daemon was compiled, the DocumentRoot is for specifying where the httpd daemon should start looking for actual web content (.html files and such).



    For my httpd.conf file I have the following Load lines:



    LoadModule auth_basic_module modules/mod_auth_basic.so
    LoadModule auth_digest_module modules/mod_auth_digest.so
    LoadModule authn_file_module modules/mod_authn_file.so


    Given this the full path to your modules would be, for example:



    /etc/httpd/modules/mod_auth_basic.so


    This is from a CentOS 5.x system but the technique is still apt.



    BTW, it can get a little confusing because in CentOS' case the files are organized physically here:



    % ls /usr/lib/httpd/modules/
    libphp5.so mod_authnz_ldap.so mod_dav_fs.so mod_headers.so mod_perl.so mod_speling.so


    ...and then accessible to the Apache daemon, httpd, through this path:



    % ls -l /etc/httpd/
    total 12
    drwxr-xr-x 2 root root 4096 Apr 26 2011 conf
    drwxr-xr-x 3 root root 4096 Apr 26 2011 conf.d
    -rw-r--r-- 1 root root 18 Feb 24 2009 htpasswd
    lrwxrwxrwx 1 root root 19 Apr 26 2011 logs -> ../../var/log/httpd
    lrwxrwxrwx 1 root root 27 Apr 26 2011 modules -> ../../usr/lib/httpd/modules
    lrwxrwxrwx 1 root root 13 Apr 26 2011 run -> ../../var/run


    The modules link connects /etc/httpd --> /usr/lib/httpd/modules.






    share|improve this answer















    I think all these answers aren't really answering the question. The root level can be determined by running the command httpd -V. This will show you what options the Apache daemon was built with at compile time. This is what controls where httpd determines where to look for it's config. files and .so modules by default.



    For example:



    % httpd -V
    Server version: Apache/2.2.17 (Unix)
    Server built: Dec 17 2010 11:58:24
    Server's Module Magic Number: 20051115:25
    Server loaded: APR 1.3.12, APR-Util 1.3.9
    Compiled using: APR 1.3.12, APR-Util 1.3.9
    Architecture: 32-bit
    Server MPM: Prefork
    threaded: no
    forked: yes (variable process count)
    Server compiled with....
    -D APACHE_MPM_DIR="server/mpm/prefork"
    -D APR_HAS_SENDFILE
    -D APR_HAS_MMAP
    -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
    -D APR_USE_SYSVSEM_SERIALIZE
    -D APR_USE_PTHREAD_SERIALIZE
    -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
    -D APR_HAS_OTHER_CHILD
    -D AP_HAVE_RELIABLE_PIPED_LOGS
    -D DYNAMIC_MODULE_LIMIT=128
    -D HTTPD_ROOT="/etc/httpd"
    -D SUEXEC_BIN="/usr/sbin/suexec"
    -D DEFAULT_PIDLOG="logs/httpd.pid"
    -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
    -D DEFAULT_LOCKFILE="logs/accept.lock"
    -D DEFAULT_ERRORLOG="logs/error_log"
    -D AP_TYPES_CONFIG_FILE="conf/mime.types"
    -D SERVER_CONFIG_FILE="conf/httpd.conf"


    The key line in that output is the HTTPD_ROOT. That defines where Apache's ROOT directory is to start, /etc/httpd in my case, when looking for config. files and modules.



    NOTE: This ROOT is not the same thing as DocumentRoot. This ROOT is specific to how the httpd daemon was compiled, the DocumentRoot is for specifying where the httpd daemon should start looking for actual web content (.html files and such).



    For my httpd.conf file I have the following Load lines:



    LoadModule auth_basic_module modules/mod_auth_basic.so
    LoadModule auth_digest_module modules/mod_auth_digest.so
    LoadModule authn_file_module modules/mod_authn_file.so


    Given this the full path to your modules would be, for example:



    /etc/httpd/modules/mod_auth_basic.so


    This is from a CentOS 5.x system but the technique is still apt.



    BTW, it can get a little confusing because in CentOS' case the files are organized physically here:



    % ls /usr/lib/httpd/modules/
    libphp5.so mod_authnz_ldap.so mod_dav_fs.so mod_headers.so mod_perl.so mod_speling.so


    ...and then accessible to the Apache daemon, httpd, through this path:



    % ls -l /etc/httpd/
    total 12
    drwxr-xr-x 2 root root 4096 Apr 26 2011 conf
    drwxr-xr-x 3 root root 4096 Apr 26 2011 conf.d
    -rw-r--r-- 1 root root 18 Feb 24 2009 htpasswd
    lrwxrwxrwx 1 root root 19 Apr 26 2011 logs -> ../../var/log/httpd
    lrwxrwxrwx 1 root root 27 Apr 26 2011 modules -> ../../usr/lib/httpd/modules
    lrwxrwxrwx 1 root root 13 Apr 26 2011 run -> ../../var/run


    The modules link connects /etc/httpd --> /usr/lib/httpd/modules.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 17 '13 at 4:03

























    answered Jan 17 '13 at 2:02









    slmslm

    5,136124460




    5,136124460












    • slm as i stated in the previous post, the ServerRoot is defined in the ServerRoot directive and has nothing whatsoever to do with HTTPD_ROOT which is displayed via "httpd -V." Please consult Apache's web pages referenced in my previous post, or if you'd like change the ServerRoot directive in your httpd.conf file and see for yourself.

      – billynoah
      Jan 18 '13 at 8:45












    • ServerRoot is a way to overrride HTTPD_ROOT. HTTPD_ROOT is set at compile time via the --prefix configure switch. Your post was distinguishing the different b/w ServerRoot and DocumentRoot. httpd.apache.org/docs/current/mod/core.html#serverroot. Good to see you registered a name with your SF account!

      – slm
      Jan 18 '13 at 13:07











    • Does this really answer the question: "How do I tell Apache which PHP to use?" ?

      – Pmpr
      Mar 3 '17 at 14:20











    • Trix the OP accepted it so yes.

      – slm
      Mar 3 '17 at 14:35











    • @slm This does not answer the question.

      – quant
      Dec 28 '18 at 9:01

















    • slm as i stated in the previous post, the ServerRoot is defined in the ServerRoot directive and has nothing whatsoever to do with HTTPD_ROOT which is displayed via "httpd -V." Please consult Apache's web pages referenced in my previous post, or if you'd like change the ServerRoot directive in your httpd.conf file and see for yourself.

      – billynoah
      Jan 18 '13 at 8:45












    • ServerRoot is a way to overrride HTTPD_ROOT. HTTPD_ROOT is set at compile time via the --prefix configure switch. Your post was distinguishing the different b/w ServerRoot and DocumentRoot. httpd.apache.org/docs/current/mod/core.html#serverroot. Good to see you registered a name with your SF account!

      – slm
      Jan 18 '13 at 13:07











    • Does this really answer the question: "How do I tell Apache which PHP to use?" ?

      – Pmpr
      Mar 3 '17 at 14:20











    • Trix the OP accepted it so yes.

      – slm
      Mar 3 '17 at 14:35











    • @slm This does not answer the question.

      – quant
      Dec 28 '18 at 9:01
















    slm as i stated in the previous post, the ServerRoot is defined in the ServerRoot directive and has nothing whatsoever to do with HTTPD_ROOT which is displayed via "httpd -V." Please consult Apache's web pages referenced in my previous post, or if you'd like change the ServerRoot directive in your httpd.conf file and see for yourself.

    – billynoah
    Jan 18 '13 at 8:45






    slm as i stated in the previous post, the ServerRoot is defined in the ServerRoot directive and has nothing whatsoever to do with HTTPD_ROOT which is displayed via "httpd -V." Please consult Apache's web pages referenced in my previous post, or if you'd like change the ServerRoot directive in your httpd.conf file and see for yourself.

    – billynoah
    Jan 18 '13 at 8:45














    ServerRoot is a way to overrride HTTPD_ROOT. HTTPD_ROOT is set at compile time via the --prefix configure switch. Your post was distinguishing the different b/w ServerRoot and DocumentRoot. httpd.apache.org/docs/current/mod/core.html#serverroot. Good to see you registered a name with your SF account!

    – slm
    Jan 18 '13 at 13:07





    ServerRoot is a way to overrride HTTPD_ROOT. HTTPD_ROOT is set at compile time via the --prefix configure switch. Your post was distinguishing the different b/w ServerRoot and DocumentRoot. httpd.apache.org/docs/current/mod/core.html#serverroot. Good to see you registered a name with your SF account!

    – slm
    Jan 18 '13 at 13:07













    Does this really answer the question: "How do I tell Apache which PHP to use?" ?

    – Pmpr
    Mar 3 '17 at 14:20





    Does this really answer the question: "How do I tell Apache which PHP to use?" ?

    – Pmpr
    Mar 3 '17 at 14:20













    Trix the OP accepted it so yes.

    – slm
    Mar 3 '17 at 14:35





    Trix the OP accepted it so yes.

    – slm
    Mar 3 '17 at 14:35













    @slm This does not answer the question.

    – quant
    Dec 28 '18 at 9:01





    @slm This does not answer the question.

    – quant
    Dec 28 '18 at 9:01













    4














    You can find files on your system with the locate command:




    # locate libphp5.so


    It will print the full paths of all files with that name. I have one at /usr/libexec/apache2/libphp5.so.






    share|improve this answer


















    • 1





      So what? is this an answer to the question? Or a way to find a file?

      – Pmpr
      Mar 3 '17 at 14:27






    • 1





      @Trix, the asker said, "I don't know what or where that is." I've shown how to find where that is. I assumed that once the asker saw all the other locations of the named file in question, it would be apparent how to change the setting to use a different one.

      – Rob Kennedy
      Mar 3 '17 at 14:50















    4














    You can find files on your system with the locate command:




    # locate libphp5.so


    It will print the full paths of all files with that name. I have one at /usr/libexec/apache2/libphp5.so.






    share|improve this answer


















    • 1





      So what? is this an answer to the question? Or a way to find a file?

      – Pmpr
      Mar 3 '17 at 14:27






    • 1





      @Trix, the asker said, "I don't know what or where that is." I've shown how to find where that is. I assumed that once the asker saw all the other locations of the named file in question, it would be apparent how to change the setting to use a different one.

      – Rob Kennedy
      Mar 3 '17 at 14:50













    4












    4








    4







    You can find files on your system with the locate command:




    # locate libphp5.so


    It will print the full paths of all files with that name. I have one at /usr/libexec/apache2/libphp5.so.






    share|improve this answer













    You can find files on your system with the locate command:




    # locate libphp5.so


    It will print the full paths of all files with that name. I have one at /usr/libexec/apache2/libphp5.so.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 23 '08 at 3:14









    Rob KennedyRob Kennedy

    1493




    1493







    • 1





      So what? is this an answer to the question? Or a way to find a file?

      – Pmpr
      Mar 3 '17 at 14:27






    • 1





      @Trix, the asker said, "I don't know what or where that is." I've shown how to find where that is. I assumed that once the asker saw all the other locations of the named file in question, it would be apparent how to change the setting to use a different one.

      – Rob Kennedy
      Mar 3 '17 at 14:50












    • 1





      So what? is this an answer to the question? Or a way to find a file?

      – Pmpr
      Mar 3 '17 at 14:27






    • 1





      @Trix, the asker said, "I don't know what or where that is." I've shown how to find where that is. I assumed that once the asker saw all the other locations of the named file in question, it would be apparent how to change the setting to use a different one.

      – Rob Kennedy
      Mar 3 '17 at 14:50







    1




    1





    So what? is this an answer to the question? Or a way to find a file?

    – Pmpr
    Mar 3 '17 at 14:27





    So what? is this an answer to the question? Or a way to find a file?

    – Pmpr
    Mar 3 '17 at 14:27




    1




    1





    @Trix, the asker said, "I don't know what or where that is." I've shown how to find where that is. I assumed that once the asker saw all the other locations of the named file in question, it would be apparent how to change the setting to use a different one.

    – Rob Kennedy
    Mar 3 '17 at 14:50





    @Trix, the asker said, "I don't know what or where that is." I've shown how to find where that is. I assumed that once the asker saw all the other locations of the named file in question, it would be apparent how to change the setting to use a different one.

    – Rob Kennedy
    Mar 3 '17 at 14:50











    4














    The parent directory of modules loaded in httpd.conf (such as: libexec/apache2/libphp5.so) is defined by the ServerRoot directive which by default is typically set to /usr. I wouldn't recommend changing this but it may be useful for someone to know just where exactly that path is defined.



    Apache's website says the following about ServerRoot:




    Relative paths in other configuration directives (such as Include or
    LoadModule, for example) are taken as relative to this directory.




    additionally the default httpd.conf file comments read:



    ServerRoot: The top of the directory tree under which the server's configuration, error, and log files are kept.






    share|improve this answer




















    • 1





      The OP is not after a definition to ServerRoot. Instead (s)he has asked the question "How do I tell Apache which PHP to use?". If you really want to answer it, so answer it

      – Pmpr
      Mar 3 '17 at 14:22















    4














    The parent directory of modules loaded in httpd.conf (such as: libexec/apache2/libphp5.so) is defined by the ServerRoot directive which by default is typically set to /usr. I wouldn't recommend changing this but it may be useful for someone to know just where exactly that path is defined.



    Apache's website says the following about ServerRoot:




    Relative paths in other configuration directives (such as Include or
    LoadModule, for example) are taken as relative to this directory.




    additionally the default httpd.conf file comments read:



    ServerRoot: The top of the directory tree under which the server's configuration, error, and log files are kept.






    share|improve this answer




















    • 1





      The OP is not after a definition to ServerRoot. Instead (s)he has asked the question "How do I tell Apache which PHP to use?". If you really want to answer it, so answer it

      – Pmpr
      Mar 3 '17 at 14:22













    4












    4








    4







    The parent directory of modules loaded in httpd.conf (such as: libexec/apache2/libphp5.so) is defined by the ServerRoot directive which by default is typically set to /usr. I wouldn't recommend changing this but it may be useful for someone to know just where exactly that path is defined.



    Apache's website says the following about ServerRoot:




    Relative paths in other configuration directives (such as Include or
    LoadModule, for example) are taken as relative to this directory.




    additionally the default httpd.conf file comments read:



    ServerRoot: The top of the directory tree under which the server's configuration, error, and log files are kept.






    share|improve this answer















    The parent directory of modules loaded in httpd.conf (such as: libexec/apache2/libphp5.so) is defined by the ServerRoot directive which by default is typically set to /usr. I wouldn't recommend changing this but it may be useful for someone to know just where exactly that path is defined.



    Apache's website says the following about ServerRoot:




    Relative paths in other configuration directives (such as Include or
    LoadModule, for example) are taken as relative to this directory.




    additionally the default httpd.conf file comments read:



    ServerRoot: The top of the directory tree under which the server's configuration, error, and log files are kept.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Dec 14 '15 at 18:49









    JakeGould

    3,2491836




    3,2491836










    answered Jan 17 '13 at 4:34









    billynoahbillynoah

    327218




    327218







    • 1





      The OP is not after a definition to ServerRoot. Instead (s)he has asked the question "How do I tell Apache which PHP to use?". If you really want to answer it, so answer it

      – Pmpr
      Mar 3 '17 at 14:22












    • 1





      The OP is not after a definition to ServerRoot. Instead (s)he has asked the question "How do I tell Apache which PHP to use?". If you really want to answer it, so answer it

      – Pmpr
      Mar 3 '17 at 14:22







    1




    1





    The OP is not after a definition to ServerRoot. Instead (s)he has asked the question "How do I tell Apache which PHP to use?". If you really want to answer it, so answer it

    – Pmpr
    Mar 3 '17 at 14:22





    The OP is not after a definition to ServerRoot. Instead (s)he has asked the question "How do I tell Apache which PHP to use?". If you really want to answer it, so answer it

    – Pmpr
    Mar 3 '17 at 14:22











    3














    Apache should be looking for modules in "/usr/libexec/httpd/". In there you'll find either a file or symlink called "libphp5.so". If it's a symlink, you'll need to relink to the new 5.2.8 libphp5.so, otherwise just copy the 5.2.8 libphp5.so to "/usr/libexec/httpd/" and restart apache with "sudo apachectl restart".






    share|improve this answer



























      3














      Apache should be looking for modules in "/usr/libexec/httpd/". In there you'll find either a file or symlink called "libphp5.so". If it's a symlink, you'll need to relink to the new 5.2.8 libphp5.so, otherwise just copy the 5.2.8 libphp5.so to "/usr/libexec/httpd/" and restart apache with "sudo apachectl restart".






      share|improve this answer

























        3












        3








        3







        Apache should be looking for modules in "/usr/libexec/httpd/". In there you'll find either a file or symlink called "libphp5.so". If it's a symlink, you'll need to relink to the new 5.2.8 libphp5.so, otherwise just copy the 5.2.8 libphp5.so to "/usr/libexec/httpd/" and restart apache with "sudo apachectl restart".






        share|improve this answer













        Apache should be looking for modules in "/usr/libexec/httpd/". In there you'll find either a file or symlink called "libphp5.so". If it's a symlink, you'll need to relink to the new 5.2.8 libphp5.so, otherwise just copy the 5.2.8 libphp5.so to "/usr/libexec/httpd/" and restart apache with "sudo apachectl restart".







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 23 '08 at 3:11







        Tautologistics




























            0














            I had a Apache and PHP installed on one of the server. This was installed by the previous sys admin. Both the Apache and PHP was complied from the source. In addition to this there was a default PHP installed. So to know which PHP is used by the Apache. I run the below command



             <Install Dir of PHP>/bin/php -i | grep apxs


            This gave me the path to apache apxs



             APACHE_HOME/bin/apxs


            This gave me info on which Apache is being used by this php. The default php gave error when i typed



            #php -i | grep apxs 

            Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory PHP Warning: PHP Startup: Unable to load dynamic library '<PHP_HOME>/lib/php/extensions/debug-non-zts-20121212/memcached.so' - <PHP_HOME>/lib/php/extensions/debug-non-zts-20121212/memcached.so: undefined symbol: OnUpdateLongGEZero in Unknown on line 0


            So in this way i was able to figure out the php used by Apache.






            share|improve this answer


















            • 1





              Please don't post the same answer twice. Instead, link to the first answer.

              – Sven
              Mar 27 '15 at 22:40















            0














            I had a Apache and PHP installed on one of the server. This was installed by the previous sys admin. Both the Apache and PHP was complied from the source. In addition to this there was a default PHP installed. So to know which PHP is used by the Apache. I run the below command



             <Install Dir of PHP>/bin/php -i | grep apxs


            This gave me the path to apache apxs



             APACHE_HOME/bin/apxs


            This gave me info on which Apache is being used by this php. The default php gave error when i typed



            #php -i | grep apxs 

            Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory PHP Warning: PHP Startup: Unable to load dynamic library '<PHP_HOME>/lib/php/extensions/debug-non-zts-20121212/memcached.so' - <PHP_HOME>/lib/php/extensions/debug-non-zts-20121212/memcached.so: undefined symbol: OnUpdateLongGEZero in Unknown on line 0


            So in this way i was able to figure out the php used by Apache.






            share|improve this answer


















            • 1





              Please don't post the same answer twice. Instead, link to the first answer.

              – Sven
              Mar 27 '15 at 22:40













            0












            0








            0







            I had a Apache and PHP installed on one of the server. This was installed by the previous sys admin. Both the Apache and PHP was complied from the source. In addition to this there was a default PHP installed. So to know which PHP is used by the Apache. I run the below command



             <Install Dir of PHP>/bin/php -i | grep apxs


            This gave me the path to apache apxs



             APACHE_HOME/bin/apxs


            This gave me info on which Apache is being used by this php. The default php gave error when i typed



            #php -i | grep apxs 

            Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory PHP Warning: PHP Startup: Unable to load dynamic library '<PHP_HOME>/lib/php/extensions/debug-non-zts-20121212/memcached.so' - <PHP_HOME>/lib/php/extensions/debug-non-zts-20121212/memcached.so: undefined symbol: OnUpdateLongGEZero in Unknown on line 0


            So in this way i was able to figure out the php used by Apache.






            share|improve this answer













            I had a Apache and PHP installed on one of the server. This was installed by the previous sys admin. Both the Apache and PHP was complied from the source. In addition to this there was a default PHP installed. So to know which PHP is used by the Apache. I run the below command



             <Install Dir of PHP>/bin/php -i | grep apxs


            This gave me the path to apache apxs



             APACHE_HOME/bin/apxs


            This gave me info on which Apache is being used by this php. The default php gave error when i typed



            #php -i | grep apxs 

            Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory PHP Warning: PHP Startup: Unable to load dynamic library '<PHP_HOME>/lib/php/extensions/debug-non-zts-20121212/memcached.so' - <PHP_HOME>/lib/php/extensions/debug-non-zts-20121212/memcached.so: undefined symbol: OnUpdateLongGEZero in Unknown on line 0


            So in this way i was able to figure out the php used by Apache.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 27 '15 at 22:09









            user2935688user2935688

            11




            11







            • 1





              Please don't post the same answer twice. Instead, link to the first answer.

              – Sven
              Mar 27 '15 at 22:40












            • 1





              Please don't post the same answer twice. Instead, link to the first answer.

              – Sven
              Mar 27 '15 at 22:40







            1




            1





            Please don't post the same answer twice. Instead, link to the first answer.

            – Sven
            Mar 27 '15 at 22:40





            Please don't post the same answer twice. Instead, link to the first answer.

            – Sven
            Mar 27 '15 at 22:40

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f428800%2fhow-do-i-tell-apache-which-php-to-use%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

            Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

            What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company