LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-21-2011, 03:54 PM   #1
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Rep: Reputation: 17
Recognizing proper verson of php


I am trying to run Drupal on a RHEL 5.5 box and am told that my PHP version is too old and must be at least 5.2

I see that my version is 5.1. I try a yum install php but am find that I have the latest version that RHN provides.

I download, configure, and install php 5.3, which appears to install correctly into /usr/local/bin. Drupal still complains about the PHP version.

I note that although my $PATH has /usr/local/bin before /usr/bin, 'php -v' gives me 5.1 and 'whereis php' gives me /usr/bin.

I try to work around this by copying /usr/local/bin/php to /usr/bin/php. Now 'php -v' gives me 5.3 but Drupal still says that my version is too old. I try to restart httpd but it does not help. Neither does 'yum remove php'.

What can I do to get php 5.3 to supercede 5.1 for Drupal?

Thanks,
Sanford Stein
CyberTools Inc.
 
Old 01-21-2011, 04:41 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You can edit /etc/httpd/conf.d/php.conf and change the libphp5.so module location to the location you've installed it
BTW you shouldn't replace /usr/bin/php with the php binary you compiled, but instead take a look again at the PATH variable, to see why /usr/loca/bin isn't before /usr/bin

Regards
 
Old 01-24-2011, 10:06 AM   #3
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Original Poster
Rep: Reputation: 17
The only libphp5.so on my system is in /usr/lib/httpd/modules. This was not created by the php install I did on Friday, so I am not clear what you are suggesting.
(Current line in the conf file is: "LoadModule php5_module modules/libphp5.so")

/usr/local/bin IS before /usr/bin in my $PATH. My question is why "whereis php" displays them in the opposite order.

Thanks,
Sanford Stein
CyberTools Inc.
 
Old 01-24-2011, 12:47 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

First of all, note that there is a php-5.3.5 package for RHEL x86 or x86_64 bit arch.

Quote:
/usr/local/bin IS before /usr/bin in my $PATH. My question is why "whereis php" displays them in the opposite order.
You didn't say how you've changed you PATH, but for this to work for anyone (you, root, the apache user etc), it's better to edit the PATH in /etc/profile
 
Old 01-24-2011, 02:51 PM   #5
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Original Poster
Rep: Reputation: 17
After a yum update and a reboot, I do 'php -v' and get 5.3.5. I can run other php programs without any problem, but the ones in the drupal directory (such as index.php) still tell me that my version is not up-to-date. So it is most likely not the system $PATH but something in the Drupal configuration.
 
Old 01-24-2011, 03:12 PM   #6
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Test what version is working on Apache by
Code:
<?php
phpinfo();
?>
 
Old 01-26-2011, 09:07 AM   #7
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Original Poster
Rep: Reputation: 17
phpinfo was showing PHP 5.1 -- that was my problem.

I fixed this by doing a make distclean on php, then re-configuring with-apxs, which I did not do orginally. Apparently this provides the hooks for Apache to pick up the proper PHP version when it is restarted. Thanks to all who responded here.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP/MySQL - Proper syntax for using alphabetical variables in a query? win32sux Programming 3 03-10-2008 06:37 AM
Editing php code easily and with proper indentation lostjohnny Linux - Software 6 07-27-2006 03:14 AM
Fedora 4 Issue with PHP not recognizing Upgrade to MYSQL DoubleAce3 Linux - General 0 02-17-2006 04:31 PM
Proper way of removing Apache, PHP and MySQL Basel Slackware 1 01-29-2006 04:34 AM
php not recognizing mysql installation martinman Linux - General 2 12-13-2003 10:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration