I have a hard time to find exact method to install PHP intl extension in Ubuntu 14.04.
I tried with sudo apt-get install php5-intl but displays error Unable to locate package.
I really need this extension for Zend Framework 2 , because of above missing extension I am getting error like this
ERROR: Zend\I18n\Validator component requires the intl PHP extension
I am using PHP 5.5.9.
How can I install PHP-intl extension in a correct way ?
For php5 on Ubuntu 14.04
sudo apt-get install php5-intl
For php7 on Ubuntu 16.04
sudo apt-get install php7.0-intl
For php7.2 on Ubuntu 18.04
sudo apt-get install php7.2-intl
Anyway restart your apache after
sudo service apache2 restart
IMPORTANT NOTE: Keep in mind that your php in your terminal/command
line has NOTHING todo with the php used by the apache webserver!
If the extension is already installed you should try to enable it. Either in the php.ini file or from command line.
Syntax:
php:
phpenmod [mod name]
apache:
a2enmod [mod name]
install it from terminal
sudo apt-get install php-intl
May be universe repository is disabled, here is your package in it
Enable it
sudo add-apt-repository universe
Update
sudo apt-get update
And install
sudo apt-get install php5-intl
In Ubuntu 20.04, PHP 7.4 use the following command:
sudo apt-get install php7.4-intl
replace 7.4 with your PHP version
So, I have problem with it. If you can't install see below.
And previously you have to add repository.
sudo add-apt-repository ppa:ondrej/php
2.1) sudo apt-add-repository ppa:ondrej/apache2
or
2.2) sudo add-apt-repository ppa:ondrej/nginx
After that you can install
sudo apt-get install php7.4-intl
Where 7.4 your php version.
For php 5.6 on ubuntu 16.04
sudo apt-get install php5.6-intl
sudo apt-get install php-intl
then restart your server
This method works for me to install PHP intl extension in Ubuntu 18.04 and nginx
sudo apt install php7.2-intl -y
you could search with
aptitude search intl
after you can choose the right one, for example
sudo aptitude install php-intl
and finally
sudo service apache2 restart
good Luck!
Related
In ubuntu 16.04 I've already checked php 7.0 version has installed.
However, I found that I have missed below extensions.
with-openssl
with-libxml-dir
with-mcrypt
enable-sockets
Is there any waty to install these php extensions easily in ubuntu 16.04?
sudo apt-get install openssl
sudo apt-get install libxml2-dev
sudo apt-get install php7.0-mcrypt
how to install sockets.installation
sudo apt-get install -y php7.0-mcrypt
Installing PHP 5.6 here is a good guide to install all of the extensions and other details but it's for Redhat and CentOS, the concept is pretty same for all though.
I want to Install php 5.3 or 5.4 on Ubuntu 16.04 Xenial and Apache.
A tutorial points me to use PPA but they are not helping me in what I need.
I know that PHP 5.3 and 4 are obsolete but I need this for a project and is this possible? If yes then please teach me how in a step by step procedure with Apache2.
you can use this package ppa:sergey-dryabzhinsky/php53 to install php 5.3, i managed with this package on ubuntu 16.
sudo add-apt-repository ppa:sergey-dryabzhinsky/php53
sudo apt-get update
sudo apt-get install php5
Before installing PHP 5.4 you need to read this notice:
Security support for PHP 5.4 has ended. You are using this repository knowing that there might be and probably are unfixed security vulnerabilities. Please upgrade to PHP 5.6 or PHP 7.0 as found in the main repository: ppa:ondrej/php
After understanding the risks , to install PHP 5.4 ,add the PPA to your sources.list:
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
Install it:
sudo apt-get install -y php5
To be safe , the PHP 5.6 version can be installed as follows:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0
sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
Update
All version prior to PHP 5.6 are unsupported
This page lists the end of life date for each unsupported branch of PHP. If you are using these releases, you are strongly urged to upgrade to a current version, as using older versions may expose you to security vulnerabilities and bugs that have been fixed in more recent versions of PHP.
*reference for PHP 5.6 downgrade from PHP 7
Install add-apt-repository
sudo apt-get install python-software-properties
Add repository for PHP 5
sudo add-apt-repository -y ppa:ondrej/php
Update
sudo apt-get update
Install php5-fpm
sudo apt-get install php5.6-fpm
Move files
sudo mv /usr/bin/php /usr/bin/php7
sudo mv /usr/bin/php5.6 /usr/bin/php
Check PHP version
php -v
Restart Apache
sudo service apache2 restart
Try to use php version switcher: phpbrew.
Supported versions
While this may not answer your problem, but PHP-5 can be installed on ubuntu 14.04 (I have tried on Amazon EC2)
You can use
sudo apt‐get install php5 libapache2‐mod‐php5 php5‐mcrypt
sudo service apache2 restart
This will install 5.5.9 as on 25-Apr-2017.
Hi I am trying to install homebrew php56 on ubuntu 14.04
I installed php 5.6 and apache2 and other dependencies of installation like perl, curl , etc.
But still I am getting this error.
That's rather a freaky way — install something on Ubuntu Linux through homebrew — it's actually should not work.
You'd better use apt package manager. You can install php-5.6 binaries from PPA:
sudo apt-get update && sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install php5
I have installed PHP7.0 on Ubuntu, but when I run php-config, it requires me to install it, which I want to install a php-config7 instead of a php-config5.
I was also stuck there but this command helped me.
I am using ubuntu 14.04
sudo add-apt-repository ppa:ondrej/php
it will install required repo for the php7
now install php-dev libs
sudo apt-get install php7.0-dev
now it will replace your old php-config to new one
now php-config will point to php-config7.0
Recently the new php7 has been released. However, when I am trying to install the gd package, the library can not be found.
I have tried through
sudo apt-get install php70-gd
and
sudo apt-get install php70-php-gd
Does anybody have an idea if gd is available for php 7?
PHP7 packages for Ubuntu including php7.0-gd can be installed via PPA for PHP by Ondřej Surý:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Next, install the desired version:
sudo apt-get install php7.0-gd
# or
sudo apt-get install php7.1-gd
# or
sudo apt-get install php7.2-gd
# or
sudo apt-get install php7.3-gd
# or
sudo apt-get install php7.4-gd
EDIT:
As MacroMan stated, under Ubuntu 16.04 you don't need to add the repository any more. Simply issuing sudo apt-get install php7.0-gd works.
just try
sudo apt-get install php7.0-gd
i got it working that way.
Greetings.
In 2018, there is an alias package for this:
sudo apt-get install php-gd
Use this to retrieve the last version.
my php version is 7.1
sudo apt-get install php7.1-gd
this command is work for me
For
Ubuntu 16.04.4 LTS
this is the command:
sudo apt-get install php7.0-gd
check php verison first using
php -v
It will give version number suppose your version is 7.0.1 then use this command to install GD Library
sudo yum install php70-gd
OR use this command depending upon server specification
sudo apt-get install php7.0-gd