im trying to update my php version to 5.2+ so i can run phpmyadmin on my server. Ive tried two different methods both produced same results. First method was to download libxml2-2.7.3 and then do ./configure, make,etc then i download php, ./configure, make install, etc. At first i had to yum install make, then a c complier cause make and ./configure didnt work before that. After everything seemed to work fine until the end when it said you may have found a bug on php would you like to submit it? So obviously the php version didnt update at all.
Next i tried adding a repo that already contained php-5.2.5 and then yum install php since centos only seems to support regular yum install up to php version 5.1.6. i did rpm and installed php and thought sweet ive updated php. Ran php -v and i am still running php version 5.1.6.
hmmm, i think i discovered the problem but im not sure how to fix it. Ive created a php file with <? php_info(); ?> in var/www/html directory and it says php version is only 5.1.6. but when i run php -v in terminal it returns 5.2.9. Is there a certain directory that php has to be installed in for it to be recognized by the web server?
nope, no difference. Terminal still says php version is 5.2.9 but php_info is saying 5.1.6.
What you get from the command line is php binary output. It depends on the prefix you have used while compiling php. How is your php configured in apache? as cgi or apache module? If CGI, you will need to make the correct binary to be recognized by apache using the AddType. Or else if it is as apache module, you will need to make sure the correct php library file is loaded into the apache conf file.
tar -zxf php-5.2.9.tar.gz
./configure --with-apxs2=/usr/sbin/apxs --with-xml --enable-bcmath --enable-calendar --with-curl --enable-ftp --with-gettext --with-mysql=/usr --with-pear