Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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.
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.