I'm trying to update from PHP 5.6 to PHP 7 on my Vagrant machine. I'm more or less following this guide https://blog.remirepo.net/post/2017/12/04/Install-PHP-7.2-on-CentOS-RHEL-or-Fedora
I've done the following:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
I follow the regular steps for activating the packages, but then when I try to update through
yum update
I get the following error:
php-pecl-mongo-1.6.16-1.el7.remi.5.6.x86_64 (#remi-php56)
Requires: php(api) = 20131106-64
Removing: php-common-5.6.36-1.el7.remi.x86_64 (#remi-php56)
The error is actually longer. But in short, it indicates that the I need the Mongo Driver for PHP 7.
How can I update this though? I'm at loss!
The mongo extension is only for PHP 5.
The mongodb extension is for PHP 5.5+ and PHP 7+
So yum blocks the transaction (expected) as one of the installed extension is not compatible with PHP 7.
You have to remove this extension before the upgrade.
Be aware than mongodb and mongo are really different extensions, with very different API.
Usually people use the mongodb/mongodb library to have a high level API
You can also consider using alcaeus/mongo-php-adapter library which provides the old mongo API using mongodb extension.
I am creating a app and am trying to install a library into my project though composer.
Composer has given me the error:
Problem 1
- The requested PHP extension ext-gmp * is missing from your system. Install or enable PHP's gmp extension.
Ok, it seems like I need to gmp extension.
I am using a Mac, and using a local test server with XAMPP.
Now this is where it starts getting confusing. I went to my XAMPP php.ini and remove the ";" from gmp extension like this:
xampp attempt
I retried composer installation with no luck. My next thought was that the extension needs to be installed on the global PHP Mac installation... I removed the ";" for gmp on that php.ini, but no luck. How can I solve this?
-if you need it for php 5 use
brew install homebrew/php/php55-gmp
-if you need it for php 7 use
brew install homebrew/php/php70-gmp
-and if you don't have homebrew, you can install it using this command
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
OR you can jsut run
brew install php#7.1
since it have all the packages you need for php 7.1
I'm currently trying to install PHP Tidy on a CentOS 7 server (I'm running PHP Version 5.4.16 if that helps as well), but am having problems with the install.
I've been running (as per the documentation)
yum install php-tidy
but get the following error:
No package php-tidy available.
Error: Nothing to do
I've found someone having the same problem here, and the answer is listed as
When I installed via CentOS tidy.x86_64 and php-tidy.x86_64 were installed but Red Hat could not find the php-tidy.x86_64 rpm and I had to add the EPEL repository, then I managed to install php-tidy.x86_64 and it worked
...but I'm not sure what to make of that.
I've also found via the official Tidy documentation:
On Redhat-ish linux, you must install both libtidy and libtidy-devel (PHP 5.x):
sudo yum install libtidy libtidy-devel
...however I also get the same "No package..." error.
My only lead is that it doesn't appear that any of the documentation has to do with CentOS 7 (I believe they use CentOS 6 or 5, or an older version of PHP) and some of the suggestions are that some systems require yum install php5-tidy instead. So hence my original question on if Tidy is supported on CentOS 7, or if there is something else I might be doing incorrectly.
Use the webtatic repo ... PHP 5.6 on CentOS/RHEL 7.1 and 6.7 via Yum
https://webtatic.com/packages/php56/
php56w-tidy
i've tried to install the extension mbstring but i have the following error:
Error: Package: php-mbstring-5.4.16-23.el7_0.3.x86_64 (updates)
Requires: php-common(x86-64) = 5.4.16-23.el7_0.3
Installed: php-common-5.4.38-1.el7.remi.x86_64 (#remi)
php-common(x86-64) = 5.4.38-1.el7.remi
Available: php-common-5.4.16-21.el7.x86_64 (base)
php-common(x86-64) = 5.4.16-21.el7
Available: php-common-5.4.16-23.el7_0.x86_64 (updates)
php-common(x86-64) = 5.4.16-23.el7_0
Available: php-common-5.4.16-23.el7_0.1.x86_64 (updates)
php-common(x86-64) = 5.4.16-23.el7_0.1
Available: php-common-5.4.16-23.el7_0.3.x86_64 (updates)
php-common(x86-64) = 5.4.16-23.el7_0.3
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
What could i do to resolve the problem ?
Thanks for your help
For people who want to know how to solve this :
sudo yum remove php-common
Then you can:
sudo yum install php-mbstring
It will automaticcaly install dependecies (php-common)
This answer from AWS Amazon forum:
yum -y install yum-utils
yum repolist all
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
Then you can install php-mbstring, and maybe, I don't know exactly, but maybe it can help for servers on Amazon only.
need to search which mbstring version required you.
cat /etc/redhat-release && php -v && yum search mbstring
========================================================================= N/S matched: mbstring ==========================================================================
ea-php54-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php55-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php56-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php70-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php71-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php72-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php73-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
now you can check what you actually need like i am using php7.1 so my command will be
sudo yum install ea-php71-php-mbstring
The selected answer is liable to change the installed PHP version. When not using the stock CentOS PHP, yum will try to install the mbstring extension for the wrong version of PHP.
You can check your installed PHP version with php -v:
$ php -v
PHP 5.5.36 (cli) (built: May 28 2016 12:05:32)
Then go ahead and install the correct mbstring version for your installed PHP version:
$ sudo yum install php55w-mbstring
You must specify the same version as your php-common, mine is php70w-common
sudo yum install php70w-mbstring
Non of above works for godaddy dedicated server centOS 6, apache 2.4, php 5.6
Instead, you should
Install the mbstring PHP Extension with EasyApache
check if you already have it by, putty or ssh
php -m | grep mbstring
[if nothing, means missing mbstring]
Now you need to goto godaddy your account page,
click manager server,
open whm ----- search for apache,
open "easy apache 4"(my case)
Now you need customize currently installed packages,
by
click "customize" button on top line next to "currently installed package..."
search mbstring,
click on/off toggle next to it.
click next, next, .... privision..done.
Now you should have mbstring
by check again at putty(ssh)
php -m | grep mbstring [should see mbstring]
or you can find mbstring at phpinfo() page
Non of above works for godaddy dedicated server centOS 6, apache 2.4, php 5.6
Instead, you should install the mbstring PHP Extension with EasyApache check if you already have it by, putty or ssh
php -m | grep mbstring [if nothing, means missing mbstring]
Now you need to go to godaddy your account page,
1.click manager server,
2.open whm ----- search for apache,
3.open "easy apache 4"(my case)
Now you need customize currently installed packages,by
4.click "customize" button on top line next to "currently installed package..."
5.In the search bar write "mbstring",
6.click on/off toggle next to it.
7.click next, next, .... privision..done.
Now you should have mbstring by check again at putty(ssh)
php -m | grep mbstring [should see mbstring]
or you can find mbstring at phpinfo() page
Thanks, my problem is done
Been searching for the answer for half day, then only realise cPanel / WHM version of CentOS will disable YUM to update php. You shall remove php* from exclude list in /etc/yum.conf.
....
Fedora 28 (Cloud Edition)
sudo yum install php56-php-mbstring
sudo yum install php70-php-mbstring
sudo yum install php71-php-mbstring
sudo yum install php72-php-mbstring
sudo yum install php73-php-mbstring
When I try to install a module through PHP PECL through cpanel or whm (CENTOS 6.3 x86_64 / WHM 11.34.0 (build 7) ) I always get this result:
ERROR: `/root/tmp/pear/imagick/configure --with-imagick' failed The
Imagick.so object is not in
/usr/local/lib/php/extensions/no-debug-non-zts-20090626
Here in another example with html_parse:
ERROR: `/root/tmp/pear/html_parse/configure --with-ekhtml' failed The
html_parse.so object is not in
/usr/local/lib/php/extensions/no-debug-non-zts-20090626
I have googled it, done the suggestions and always the same result.
What library are you trying to install?
I've found mixed results using pecl on Redhat, centos, or fedora machinces if I've ever used yum to install their versions of PHP libs. The easiest way around your issue would be to look to see if it's in the Yum repo and install it that way:
yum search 'modulename'
yum install 'packagename'
I usually just do a yum search php and scan down the list of modules.
If you want to use pecl or can't because the libraries aren't part of yum, I'd remove the natively included version and build your PHP from scratch. You can remove PHP and related libraries installed with the distro via yum as well.
I have a similar server setup and I needed pecl_http. Instead of using WHM (Home »
Software » Module Installers) I used command line. Simply typed: pecl install pecl_http
It should be the same for other modules like the html_parse, just change the module name, like: pecl install html_parse
Figured I'd add this for anyone else looking for this info.