SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    273
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry which php ... issue pls help

    Hey Guys,

    We have a red hat box which has php in /usr/bin/php when i do a php -v its version is 4.3.9

    We have apache installed in /usr/local/lamp/ and php version 5.2.4 in the same directory /usr/local/lamp/php

    However when the webserver is up it uses the 4 version. Also when i do a random which php on the shell it gives me /usr/bin/php and on doing a php -v on it gives me the 4.3.9 version.

    How do i get to set it to use the new php 5.2.4 version ?

    Please help
    RJ

  2. #2
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    273
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any one ?

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    /usr/local/lamp/ needs to be before /usr/bin/ in your $PATH environment variable. However, you should just do away with the PHP installation in /usr/local/lamp/ and upgrade the one in your /usr/bin/ folder.

    For your web server, edit your Apache configuration file to point the PHP parser to the PHP installation that you desire.

  4. #4
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    273
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot for u r reply.. how do i upgrade the one in /usr/bin .. i am a newbie please guide .. also .. i dont get it when u say edit httpd conf file. the conf file only lists the load modules and not any particular php...

  5. #5
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How did those two installations of PHP come into existence?

  6. #6
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    273
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the /usr/bin/php was already there with red hat is what my sr admin told me. for the web server they needed updated so they installed a new on in /usr/local/lamp/php/bin

    i did the php complie this way. went to /usr/src/php5/ then ./configure command with options
    './configure' '--with-oci8=instantclient,/usr/oracle/product/10.2.0/client' '--with-apxs2=/usr/local/lamp/bin/apxs' '--prefix=/usr/local/lamp/php' '--disable-cgi' '--with-mysql'

  7. #7
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There should be a LoadModule line in httpd.conf that references libphp4.so. You need to change that to point to the right libphp5.so file.

  8. #8
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    273
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    # LoadModule foo_module modules/mod_foo.so
    LoadModule php5_module modules/libphp5.so
    LoadModule rewrite_module modules/mod_rewrite.so
    AddHandler php5-script php
    #


    this is the setting.. do u think i shud give the complete path at modules/libphp5.so ?

  9. #9
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    273
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well?

  10. #10
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You must, or you otherwise you must copy libphp5.so to your Apache modules folder instead.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •