Upgrade PHP to 5.2.12 on CentOS using yum - php

I tried to find a simple way to upgrade PHP on my CentOS5 machine using yum instead of downloading the source and compiling it again myself (I did it last time, but it's really difficult to get all the compile configurations same as CentOS's default). Anyway, I finally use the methods listed here:
http://www.atomicorp.com/wiki/index.php/PHP
Now, the command php -v shows the version is already 5.2.11 (which I needed) , but it always contains many warnings like:
PHP Warning: PHP Startup: fileinfo: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mssql: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
I think it basically means that I need to recompile these four modules, how could I do that? Any suggestions are appreciated.

This is really easy, you need to add more upto date yum repository and then upgrade.
one example is here.
cat >> /etc/yum.repos.d/utterramblings.repo <<END
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL5/i386/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
After this you would get latest versions of php and other extensions. It works!!

PHP is not installed all at once, it's modular. So you have things just like you listed that are designed for a different version of PHP. You will need to install all the plugins you are using for your implementation for the version of PHP you have installed.
Short answer, if you want a REALLY up to date PHP version, don't use CentOS. It's just a pain. CentOS is about stability, not cutting edge software. Use Ubuntu or Debian.
Long answer, your best option hands down is to compile from source or to find a repository that provides PHP 5.1.whatyouneed. I would advise against using a repository unless you are VERY sure that it comes from a reputable source.
If I was to do this I'd compile PHP from the source. Here is a link to get you started: http://www.wolflabs.org/2008/12/08/installing-php-from-source-on-centos-x86_64-w-apache/

You should grab the SRPM, replace the tarball, and rebuild it. You may want to grab the "extras" SRPM as well if you need anything from it.

here is repo configuration I've used to upgrade PHP on CentOS 5 (look for Enterprise Linux 5 in the text)
http://blog.famillecollet.com/pages/Config-en

Try
pecl install fileinfo readline memcache
And this should fix the problem.

pecl install memcache
Worked for me running Centos 5.5

I followed a CentOS wiki on how to upgrade PHP using a testing repository:
http://wiki.centos.org/HowTos/PHP_5.1_To_5.2
I was getting errors for fileinfo and memcache, so I tried:
pecl install fileinfo memcache
...and all of the warnings vanished.

Related

i am using php 5.6.24 in xamp and i'm installing V8js extension and getting following warning

php -i | findstr "Thread"
PHP Warning: PHP Startup: v8js: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0
Thread Safety => enabled
You have installed the wrong version of the extension. You need the version that is compiled with API 20131226. So you have to search for the correct version and install them. Then is should work.
https://github.com/terrylinooo/v8js-dll
here you can see the versions that are included. So normally if you have used the correct version it should be correct.

PHP Warning: PHP Startup: solr: Unable to initialize module

I'm getting the below warning while adding the solr-client extinctions.
PHP Warning: PHP Startup: solr: Unable to initialize module
Module compiled with module API=20131226
PHP compiled with module API=20121212
These options need to match in Unknown on line 0
can any one Please hep me out in this ?
PHP Warning: PHP Startup: solr: Unable to initialize module
1:Check extension_dir directive in php.ini. It should point to folder with 5.2 modules.
2:This is because PHP extensions are developped in C, and are "close" to the internals of PHP -- which means that, if the APIs of those internals change, the extension must be re-compiled, to use the new versions.
And, between PHP 5.2 and PHP 5.3, for what I remember, there have been some modifications in the internal data-structures used by the PHP engine -- which means extensions must be re-compiled, in order to match that new version of those data-structures.
How to update your PHP extensions will depend on which system you are using.
If you are on windows, you can find the .dll for some extensions here : http://downloads.php.net/pierre/
For more informations about the different versions, you can take a look at what's said on the left-sidebar of windows.php.net.
If you are on Linux, you must either :
Check what your distribution provides
Or use the pecl command, to re-download the sources of the extensions in question, and re-compile them.

PHP Installation Yosemite

I believe I have an issue with my PHP installation
When I type php into the command line, i get the following
PHP Warning: PHP Startup: pdo_pgsql: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: pgsql: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
Can anyone advise?
I tried this - http://jason.pureconcepts.net/2014/11/install-apache-php-mysql-mac-os-x-yosemite/
As the author of that post, the issue is with the previously compiled modules pdo_pgsql and pgsql.
As noted in the comments, you will need to reinstall these modules for the Yosemite's of PHP (run php -v).
Steps for doing so with these specific modules has been answered already.
I just had the same issue and I don't use Postgres so I really didn't care for installing PEAR and then autoconfig, etc.
So I found that you can simply comment out those extensions in php.ini
To find the ini file location:
php -i | grep php.ini
And then comment out the above 2 extensions in the ini file. Mine was located at: /Library/Server/Web/Config/php/php.ini

PHP Startup ffmpeg Unable to initialize module

When start Apache I get this error..
How can I solve it?
PHP Warning: PHP Startup: ffmpeg: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20100525
These options need to match
extension=php_ffmpeg.dll : added to php.ini
php_ffmpeg.dll copied to php/ext
avcodex-51.dll/ avformat-51.dll/ avutil-49.dll/ pthreadGC2.dll : added to C:\Windows\SysWOW64
The php_ffmpeg.dll was compiled with an older version of PHP. It's possible your PHP installation was updated but the module was not. You will need to get an updated version the the php_ffmpeg module or remove it.

PHP can't connect to Mongodb

I followed the windows installation instructions in mongodb's website but I still can't connect to MongoDB through PHP because of this error:
Class 'Mongo' not found
Why isn't the file containing the Mongo Class not being loaded?
I've also found this error:
PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=1
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
I'm using php 5.2.5 and the mongo-php-driver is Windows PHP 5.2 VC6 thread safe
Thanks
The driver was compiled for php 5.3 though the name suggests otherwise.
Can you upgrade to php 5.3(.2) ?
On archlinux, Installing php-mongo 1.2.10-1 solved this problem for me.

Categories