Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm just starting learning Linux. I'm using CentOS 6.3 and i really like it. However I need PHP 5.4, currently not available for CentOS. I've read that CentOS, for its very own nature, doesn't update packages frequently.

Which distribution would you suggests for replacing CentOS and let me enjoy latest version of both Apache/PHP?

share|improve this question

5 Answers 5

up vote 4 down vote accepted

Don't give up on CentOS just yet!

A common process for resolving this problem is to tap into the REMI repository in order to obtain current PHP and MYSQL packages.

This should satisfy your request and still keep things manageable via Yum.

Instructions:

You will need the EPEL repository first. Then the REMI files.

wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

That's all in order to get the repo. For PHP, something like:

yum --enablerepo=remi,remi-test install nginx php php-fpm php-common php-pear php-pdo php-mysql php-pgsql php-pecl-memcache php-gd php-mbstring php-mcrypt php-xml
share|improve this answer
    
Can't find any help to install REMI repository. Any clue? Those examples are for Fedora... –  user34295 Aug 25 '12 at 16:27
    
See my edits above. –  ewwhite Aug 25 '12 at 16:48

You can install PHP 5.4 via Webtatic repo:

Name       : php54w
Arch       : x86_64
Version    : 5.4.6
Release    : 1.w6
Size       : 1.2 M
Repo       : webtatic
Summary    : PHP scripting language for creating dynamic web sites
URL        : http://www.php.net/
License    : PHP
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
           : easy for developers to write dynamically generated webpages. PHP also
           : offers built-in database integration for several commercial and
           : non-commercial database management systems, so writing a
           : database-enabled webpage with PHP is fairly simple. The most common
           : use of PHP coding is probably as a replacement for CGI scripts.
           : 
           : The php54w package contains the module which adds support for the PHP
           : language to Apache HTTP Server.
share|improve this answer

I have best results on Centos 6 using EPEL with IUS repositories.

http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-10.ius.el6.noarch.rpm http://fedora.mirror.nexicom.net/epel/6/i386/epel-release-6-7.noarch.rpm

# yum search php54

The combined repositories give excellent package access with very low version conflict. This is also a great way to get nginx and php-fpm.

share|improve this answer

If it's a development machine (i.e., not a long lived server), you can look at the closely related Fedora. The current version of Fedora ships with PHP 5.4.1.

The Fedora Project is sponsored by Red Hat as a sort of test bed for future RHEL ideas, so both CentOS and Fedora are closely related. The trick is that Fedora is cutting edge (new releases are every 6 months), but security and bug-fix updates will cease after about 13 months, which makes it unsuitable for server deployments.

You should also consider how PHP 5.4 will get installed on any future server platform. As noted, Fedora isn't suitable for server deployment unless you don't expect the server to be around a year later, as it will be unsupported at that point.

share|improve this answer

You could install the compiler, tools and libs;

 # yum groupinstall 'Development Tools'

Then compile Apache and PHP from source into /opt/local, then add that to your $PATH

share|improve this answer
    
As i said i'm just learning *nix. How can you think i'll be able to compile myself? –  user34295 Aug 25 '12 at 16:28
    
Because you're learning. This method of installing software forces you to learn a lot speedily. –  Timothy Makobu Aug 27 '12 at 11:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.