php broken after upgrade/downgrade

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • btltm818
    New Member
    • Jan 2010
    • 2

    #1

    php broken after upgrade/downgrade

    Hello,

    I seem to have corrupted our php5.1.6-24 installation. I installed using an RPM. I attempted to upgrade to php2.11 (not supported by RHEL!) and compiled from a *bz2 file to enable SOAP but php code would not run after the compile although "make install" completed successfully.

    I reinstalled 5.1.6.24 using yum. I noticed that there was no /usr/bin/php so I created a link to /usr/local/bin/php and then noticed that it's actually point to php5.2.11(cli). All php scripts I have checked are now working and phpinfo show php5.1.5-24.

    However, php -v points to php5.2.11. I cannot find the executable for 5.1.6-24.
    How can I fix this? Can I remove all php directories and do a clean installation?

    Any advice would be greatly appreciated!
    Last edited by btltm818; Jan 25 '10, 06:29 PM. Reason: made changes
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    If you plan to compile it yourself, you should remove all package versions first. This reduces the risk of the two versions colliding.

    I would also recommend setting a custom path when you configure it. When setting up my own Ubuntu server (with PHP5.3), I used something like:
    Code:
    ./configure -prefix=/opt/php/531 \
                -with-apxs2=/usr/bin/apxs2  \
                -with-mysql=/usr  \
                -with-mysqli=/usr/bin/mysql_config  \
                etc..
    You can then just create a symbolic link for the php executable in the /usr/bin directory, or add the PHP bin directory to the PATH. (I would do the former)

    And to enable this PHP installation in Apache, it is just a matter of moving the libphp5.so file from the build directory into the Apache module directory and setting the correct configuration. For me, that looked something like:
    Code:
    LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
    PHPINIDir /etc/php5/apache2/php.ini
    Note that it seems that, sometimes, the .bz2 tarball doesn't produce the libphp5.so file. You may have to use the .gz version. - This happened to me when installing PHP5.3.

    It's weird, considering they contain the same exact files...

    Comment

    • btltm818
      New Member
      • Jan 2010
      • 2

      #3
      Hey Atli,

      Thanks for the help! Are you saying that I should remove the PHP directory(/usr/local/lib/php) and all php rpms and then reinstall? I only want 1 version running.

      Comment

      Working...