Intl php extension issue - how do I install and use?

Intl php extension issue - how do I install and use?

by brian avery -
Number of replies: 16

Hi,

During the course of upgrading to 2.0 I received a message saying that I should install and use the intl php extension. In admin/server/environment I still have the same message. I can see it's optional, but also recommended.

I followed the info link from within moodle that took me to a help page (http://docs.moodle.org/en/admin/environment/php_extension/intl) explaining what it is etc, but there was nothing there to help. There were instructions for those people using moodle on windows, but I believe my hostgator site runs on unix..so this doesn't help me.

Are there any docs I haven't seen which tell me in simple words what I need to do? Or is it really not necessary?

Thanks, Brian

Average of ratings: -
In reply to brian avery

Re: Intl php extension issue - how do I install and use?

by Nathan Cobb -

Hi

I may be wrong as I'm more familiar with Windows installs but I would imagine you still need to look for the php.ini file and uncomment the relevant extensions when you find the list of extensions.

Hope this helps.  Apologies if it isn't relevant.

In reply to brian avery

Re: Intl php extension issue - how do I install and use?

by Nadav Kavalerchik -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

I have updated the Docs pages with install instruction for Linux systems (Debian & CentOS)

Hope you have a linux server. (for many reasons smile)

smile

In reply to Nadav Kavalerchik

Re: Intl php extension issue - how do I install and use?

by brian avery -

Hi,

Well, according to cpanel my op system is linux. However, having browsed cpanel and the various options that relate to php, I can't see anything that remotely resembles the instructions in Docs:

Use system package manager or specify compilation flag.

  • Debian 5.0 (& Ubuntu) use: apt-get install php-intl
  • CentOS 5.5 (& RedHat) you should (probably) be using php 5.3 from remi and then use: yum install php-intl

Nor, for that matter, does it mention debian or centos. I'm as lost as it's possible to be, not having any knowledge of php. With the other problems that upgrading has spat out, I've spent the best part of my day trying to work out why nothing works properly and got absolutely nowhere! Feels like moodle is for programmers, not us dumb teachers.

Thanks anyway,

Brian

In reply to brian avery

Re: Intl php extension issue - how do I install and use?

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

ROFL@Brian's Dumb Teacher comment!

In reply to Mary Evans

Re: Intl php extension issue - how do I install and use?

by brian avery -

You have some cool icons. Got a similar one that shows Mr Smiley beating his head against a wall?

In reply to Nadav Kavalerchik

Re: Intl php extension issue - how do I install and use?

by Chris Scurrah -

I have got my hosting company to install the php-intl extension (ICU - International Components for Unicode) for me but I don't know what to enter in php.ini to get it to load, can you tell me what I need to add to it?

p.s. I'm using a dedicated linux server

In reply to Chris Scurrah

Re: Intl php extension issue - how do I install and use?

by brian avery -

Well, I spoke to Hostgator, who say they can install intl-php for me (apparently it's a global change, whatever that means) so I guess my next question will be the same...about how to get it to load. Any help will be appreciated.

In reply to Nadav Kavalerchik

Re: Intl php extension issue - how do I install and use?

by brian avery -

Nadav,

Thank you for your earlier help. I have now spoken to Hostgator and discovered something....

I recently saw a comment in the progress towards 2.1 notes about testing for and pushing users toward php 5.3.3 on the grounds (as far as I recall) that it was quicker. Taking the hint, I upped my php from 5.2.14 to 5.3.something.

I also asked Hostgator why Intl didn't appear to be working yet (according to moodle 2.0+). I got this response this evening...

"I have escalated this to an L2 admin and they have found that this function will not compile with php5.3. There seems to be no issue with 5.2. I see that you had just upgraded to PHP 5.3, was there a conflict with your moodle version and 5.2 or was the upgrade just recommended? Would it be possible to use php 5.2 instead of 5.3? They can install it with that version of php instead of what you currently have."

If this is true, then there will be a conflict between wanting the intl extension and also running php 5.3

Anyway, now I guess I have to downgrade to 5.2 again to get intl.

Brian

In reply to brian avery

Re: Intl php extension issue - how do I install and use?

by Nadav Kavalerchik -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

Just now, i came back from a Moodle 2 servers install session.

We have installed 3 machines: Ubuntu, Debian and CentOS 5.5

All of them with php 5.3 ( and Moodle 2, of course )

It all went smoothly.

Here are the details of the actual commands we used and the output that was generated after each install phase : link. hope it helps smile

In reply to Nadav Kavalerchik

Re: Intl php extension issue - how do I install and use?

by brian avery -

Thank you, I'll see if it helps. Hostgator keep telling me I can't have intl and 5.3

If I can't solve the issue, I have a choice - 5.3 or intl. In your opinion, which is more beneficial for the current moodle 2.0 release?

Brian

In reply to brian avery

Re: Intl php extension issue - how do I install and use?

by Nadav Kavalerchik -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

If you are using no-English languages on your Moodle system, you should defenetly get php5-intl extention.

In reply to Nadav Kavalerchik

Re: Intl php extension issue - how do I install and use?

by vic pacunayen -

Hi,

I tried to install php-intl and mbstring using below command but it says no package available.

How can I install php-intl and php-mbstring?Please help.

# yum install php-intl
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
No package php-intl available.
Error: Nothing to do

# yum install php-mbstring
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
No package php-mbstring available.
Error: Nothing to do

In reply to vic pacunayen

Re: Intl php extension issue - how do I install and use?

by Ken Task -
Picture of Particularly helpful Moodlers

@vic

Uhhh ... 'This system is not registered to Red Hat Subscription Management.'  Has your subscription for support expired?

Red Hat Enterprise Linux Server release 6.4 does have php-intl.

PHP 5.3.x may not be default for a RHEL server version 5.

What would you get if using:

yum list php53*

Also, you *MIGHT* be able to use CentOS repos:

http://cotdp.com/2012/07/installing-centos-packages-on-red-hat-enterprise-linux/

2 exceptions to the article above:

1. the repo URL might need to be pointed to a server closer to your location.

2. do NOT enable the repo by default: enable=0 in config.

Use by enabling the repo in the yum command itself for acquiring very specific software.  Strongly advise study of yum if you mix CentOS repos with a commercial RHEL server.

'spirit of sharing', Ken

In reply to vic pacunayen

Re: Intl php extension issue - how do I install and use?

by Wes Matchett -

I'm getting the same error on a registered RHEL system:

# yum install php-intl
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
rhel-6-workstation-rpms                                                                                                                                    | 3.8 kB     00:00
Setting up Install Process
No package php-intl available.
Error: Nothing to do

php-mbstring installed just fine. I checked my php version and it is 5.3.3:

# php -v
PHP 5.3.3 (cli) (built: Dec  5 2013 07:09:40)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Any ideas?

In reply to Wes Matchett

Re: Intl php extension issue - how do I install and use?

by Ken Task -
Picture of Particularly helpful Moodlers

@Wes ...

RedHat is somewhat notorious for being 'conservative' with versions it offers from their primary repositories when it comes to PHP and MySQL.   Thus adding webtatic, epel, remi repos to the system will provide what is desired.

http://webtatic.com/packages/php54/

Note: php55 is also offered.

You want to follow EL6 info on the above link.

And, would highly recommend editing the webtatic repo file found in /etc/yum.repos.d and set it to in-active to prevent conflicts with other packages ... just interested in PHP and MySQL.   To use webtatic repo one will have to add --enablerepo=webtatic to yum commands.

And, strongly suggest upgrading the PHP from 5.3.3 to 5.4 or 5.5 as beginning with Moodle 2.7 there are newer requirements for PHP and MySQL.  PHP 5.4/.5 has Zend Opcache built in.  Moodle 2.7.x (long term support version) should be the destination (eventually).

Dunno how familiar you are with yum but I've found one has to remove php, php-*, and php-commons from the system first, in order to use the upgraded packages from webtatic.   That will break anything running under PHP on server until one installs from webtatic.

While you are at it, may as well upgrade the MySQL version as well.   Don't forget to run mysql_upgrade after upgrading version of MySQL ... might have to use a --force option.

man mysql_upgrade has info

'spirit of sharing', Ken