Dependency problems between php 5.3 and php 5.6 - php

Originally I had php 5.3 installed in my centos machine (version 6.4) .. however I upgraded the version of php to be 5.6 using these commands lines :
yum remove php-common
yum install php56w
yum install php56w-mysql
yum install php56w-common
yum install php56w-pdo
yum install php56w-opcache
Actually when I run php -v it gives me : 5.6.
However when I'm trying to install the package php-devel:
sudo yum install php-devel --skip-broken
it gives me :
Packages skipped because of dependency problems:
php-5.3.3-47.el6.x86_64 from base
php-cli-5.3.3-47.el6.x86_64 from base
php-common-5.3.3-47.el6.x86_64 from base
php-devel-5.3.3-47.el6.x86_64 from base
How may I correct this dependency problem ?
Thanks

You should install the 5.6 version of php-devel.
sudo yum install php56w-devel
On this link you can see the list of packages for centos and php5.6 on the "packages" section:
https://webtatic.com/packages/php56/

Related

Would like a php version of php 8.1 for a specific virtual website

I have a virtual website in an ubuntu 18.04 server that is written in Laravel9 and it needs php version 8.0.2 or higher. The error looks like this in the browser:
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2".
In the system I have PHP 7.4.29 (cli) but can't change that due to other virtual sites who need 7.4.
How do I get php 8.1 to the Laravel9 site so it works?
Ok, found out that what was needed was a composer command:
composer install --ignore-platform-reqs
So now no error anymore. Now I have other things to worry about, but thats Laravel stuff.
My other sites works ok despite php 8.1 now.
Thanks any way for your help.
If using Debian/Ubuntu:
apt -y install software-properties-common
add-apt-repository ppa:ondrej/php
apt -y install php8.1
CentOS:
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf remove php* -y
dnf module list reset php -y
dnf module enable php:remi-8.1
dnf install php

Possible to install mcrypt in PHP 7.1 on Oracle Linux 7?

Is it possible to install mcrypt in PHP 7.1 running on Oracle Linux 7? This is not listed in the repo here.
I thought that I might be able to install it using "yum install epel-release" and "yum -y install php-mcrypt", however the package is listed as unavailable:
yum -y install php-mcrypt
Loaded plugins: langpacks, ulninfo
No package php-mcrypt available.

Install mongodb driver for php 7.1 on RHEL 7.1

I am trying to install mongodb driver for php 7.1 but not found any solution.
Used following command
pecl install mongodb
But gives , pecl command not found. Tried to install pecl by
yum install pecl
But given no package available
Try install php-pear package. pecl is included on it.
P.S. See https://pkgs.org/download/php-pear
You can also use yum packages:
yum install php71-php-pecl-mongodb.x86_64 -y

Can I install php-ldap 5.3.3 when my php version is 5.4.31?

I have php 5.4.31 installed on a Centos 6 machine.
When I use
yum install php-ldap
The information yum provides me after I run the command is in the picture.
So yum asks whether I want to install php-ldap version 5.3.3-49 and php-common version 5.3.3-49. Can I let yum install these suggested packages?
My server has php version 5.4.31 and I want to keep it like that for now.

struggling to install PHP pecl on Centos

I'm trying to install the php_http PHP extension on my CentOS server.
I have done:
yum install php-pear
But get:
No package php-pear available
Yet I can do:
pear
And get a list of commands from Pear.
Same for yum install pecl. I can do pecl but pecl install pecl_http returns:
No releases available for package "pecl.php.net/pecl_http"
install failed
Yet /usr/bin/pecl isn't a directory that exists. Also a sudo pecl install pecl_http returns sudo: pecl: command not found, which I find quite odd.
I'm not entirely sure what's going on here/what I'm doing wrong.
edit: I am using the following repos:
base CentOS-6 - Base
epel Extra Packages for Enterprise Linux 6 - x86_64
extras CentOS-6 - Extras
rpmforge RHEL 6 - RPMforge.net - dag
updates CentOS-6 - Updates
vz-base vz-base
vz-updates vz-updates
On CentOS,
Install PHP Pear if not installed yet:
# yum install php-pear
Install GCC if not installed yet:
# yum install gcc
Install cURL if not installed yet:
# yum install curl-devel
Install following libraries if not installed yet:
# yum install php-devel
# yum install zlib-devel
# yum install pcre-devel
Start the main installation:
# pecl install pecl_http
Add the following line to /etc/php.ini file
extension=raphf.so
extension=propro.so
extension=http.so
Restart apache server so the extension can be loaded
# service httpd restart
You can check if it installed successfully or not:
# pecl list
Step 1) import the REMI repo
CentOS 5
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm;
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm;
CentOS 6
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm;
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm;
Step 2) install php-pear
yum --enablerepo=remi,remi-php55 install php-pear
Step 3) install pecl_http
pecl install pecl_http
For other people having this problem. I discovered this question while trying to figure out why I was having the same problem. Turned out the default configuration at my hosting provider was to include php* in the exclude directive for yum. Check /etc/yum.conf and make sure that the package you're trying to install isn't matched by an entry in the exclude directive.
if you are running php 7 you might want to try this
yum install php70w-pear
if you get any errors, be sure to uninstall the pear package from any previous attempts
yum remove php-pear
best of luck
If you are using php 5.4.x, IMO best repo to use is iuscommunity. Its very stable and used by Rackspace to do only PHP and a few other packages for CentOS.
rpm -Uhv http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-11.ius.centos6.noarch.rpm
yum install php54-pear
Mind you, the reason why its php54-pear and not php-pear is because 5.3 and 5.4 both are compiled in the repository. Here is the list of php packages -> http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/repoview/development.languages.group.html
I tested this and it works, but I only use EPEL and iuscommunity REPO's. I avoid using rpmforge myself.
Centos 6.5 and php7:
sudo su -
yum install yum-utils
you can get last version of lua : http://pecl.php.net/package/lua
wget http://pecl.php.net/get/lua-2.0.4.tgz
tar -xvzf lua-2.0.4.tgz
cd lua-2.0.4
mkdir /usr/include/lua
mv * /usr/include/lua
yum install gcc
yum install php70w-pearl php70w-devel
yum install curl-devel
yum install zlib-devel
yum install pcre-devel
ln -s /usr/include/lua.h /usr/include/lua/lua.h
rpm -Uvh https://centos6.iuscommunity.org/ius-release.rpm
yum-config-manager --enable remi-php70
yum update
yum --enablerepo=remi,remi-php70 install php70w-pear
yum install lua-devel lua-static
pecl install lua-2.0.4
Whatever your PHP provider is (IUS, Remi or Webtatic), the pear package and the pecl extensions "should" be available there, without any need to compile it from sources (which is usually discouraged, especially on production)
At least "remi" provides most extensions, see the list
So installation should be as simple as
yum install php-pecl-http
yum install php-pecl-lua
etc
And, don't forget to read the Wizard instructions
I tried almost everything on this list before I finally realized that my WHM/cPanel installation was blocking the yum packages. I have to install all PECL modules (I was stuck trying to install mongodb on this particular occation) through the Home > Software > Module Installers inside WHM (cpanel documentation says that you have to be logged in as root).
After watching a lot of threads and installing pear and all the devtool, I finally solved it installing this extension:
yum install php-pecl-mongo
as I seen in - https://madcoda.com/2012/12/install-mongodb-php-driver-in-centos-6-3/

Categories