I can't install any package related PHP, I get a yum error: No package php available.
My PHP version is 5.4.37 on Centos 7. I installed remi for other purposes and I think that the repository is not compatible with PHP version but I don't know how to fix it.
[root#server ~]# sudo yum install php php-pear
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centosmirror.netcup.net
* epel: mirrors.n-ix.net
* extras: centosmirror.netcup.net
* remi: mirror5.layerjet.com
* remi-safe: mirror5.layerjet.com
* updates: centosmirror.netcup.net
No package php available.
No package php-pear available.
Error: Nothing to do
You have, in yum configuration:
exclude=apache* httpd* mod_* mysql* MySQL* mariadb* da_* ftp exim* sendmail* php* bind-chroot*
This is very probably a "panel" enabled server (cpanel or others), which provides its own PHP stack.
So by design, you cannot install "php*" packages from standard repository or any other 3rd party repository. Such distribution is so altered, that it is often considered as "Not CentOS".
So, better to ask your php stack provider for how to update it (if possible, without breaking the panel application)
As suggested in other answer, this may be related to excludes set in yum.conf
The command below allows to run the installation of excluded packages without modifying the conf file:
yum --disableexcludes=main install php
BUT
It seems like it might be better to re-install PHP by the means of the control panel installed. IE Cpanel - EasyApache..
Related
After I use yum installed the php7.0:
yum install php70w
now how to start it?
# whereis php
php: /usr/bin/php /usr/lib64/php /etc/php.d /etc/php.ini /usr/local/bin/php /usr/share/php /usr/share/man/man1/php.1.gz
I also can not find the php-fpm:
# find / -name php-fpm
I installed apache, in /usr/local/httpd/.
EDIT-1
# yum install php7.0 libapache2-mod-php7.0
loaded:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* epel: mirror.premi.st
* extras: mirrors.163.com
* updates: mirrors.163.com
* webtatic: sp.repo.webtatic.com
No package php7.0
No package libapache2-mod-php7.0
Error: there is no ..
First To see the available options for PHP modules and libraries, you can type this into your system:
sudo yum search php-
The results are all optional components that you can install. It will give you a short description for each:
php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php-cli.x86_64 : Command-line interface for PHP
php-common.x86_64 : Common files for PHP
php-dba.x86_64 : A database abstraction layer module for PHP applications
php-devel.x86_64 : Files needed for building PHP extensions
php-embedded.x86_64 : PHP library for embedding in applications
php-enchant.x86_64 : Enchant spelling extension for PHP applications
php-fpm.x86_64 : PHP FastCGI Process Manager
php-gd.x86_64 : A module for PHP applications for using the gd graphics library
. . .
To get more information about what each module does, you can either search the internet, or you can look at the long description in the package by typing:
yum info package_name
There will be a lot of output, with one field called Description which will have a longer explanation of the functionality that the module provides.
For example, to find out what the php-fpm module does, we could type this:
sudo yum info php-fpm
Along with a large amount of other information, you'll find something that looks like this:
. . .
Summary : PHP FastCGI Process Manager
URL : http://www.php.net/
License : PHP and Zend and BSD
Description : PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI
: implementation with some additional features useful for sites of
: any size, especially busier sites.
If, after researching, you decide you would like to install a package, you can do so by using the yum install command like we have been doing for our other software.
If we decided that php-fpm is something that we need, we could type:
sudo yum install php-fpm
If you want to install more than one module, you can do that by listing each one, separated by a space, following the yum install command, like this:
sudo yum install package1 package2 ...
At this point, your LAMP stack is installed and configured. We should still test out our PHP though.
I'm newbie, I'm trying to install php mod fastcgi for apache 2.2 on centos 6.8, but I got error with message: "No package mod_fastcgi available. Nothing to do".
Please help me, thank so much.
[root#host15 ~]# yum install -y mod_fastcgi
Loaded plugins: fastestmirror, priorities
Setting up Install Process
Loading mirror speeds from cached hostfile
base: mirror.digistar.vn
epel: mirrors.digipower.vn
extras: mirror.digistar.vn
remi: mirror.upb.edu.co
remi-php56: mirror.upb.edu.co
remi-safe: mirror.upb.edu.co
updates: mirrors.viethosting.com
2347 packages excluded due to repository priority protections
No package mod_fastcgi available.
Error: Nothing to do
This mod_fastcgi extension is dead for years, and not available in the repositories.
You can use, instead
mod_fcgid, see its documentation and package information
mod_proxy_fcgi, see its documentation and package information
The second one is a backport from httpd 2.4 to 2.2 of the default fastcgi implementation. To use it, see the ProxyPass directive.
I've installed phpmyadmin (4.5.3.1) on CentOS 07 with apache server (httpd-2.4.18) and PHP 7.0.1. I get the error:
The mbstring extension is missing. Please check your PHP configuration.
So I searched the internet for this error and people came with the following solution, which I tried:
Installing the php-mbstring and php-mcrypt extensions:
yum install php-mbstring php-mcrypt php-gd
this command returns:
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.viethosting.vn
* epel: ftp.cuhk.edu.hk
* extras: mirrors.viethosting.vn
* updates: mirrors.viethosting.vn
Package php-mbstring-5.4.16-36.el7_1.x86_64 already installed and latest version
Package php-mcrypt-5.4.16-3.el7.x86_64 already installed and latest version
Package php-gd-5.4.16-36.el7_1.x86_64 already installed and latest version
Nothing to do
Please help me!
I was wondering for like 2 hours for this issue and the only thing I missed was restarting php-fpm along with httpd.
So this freaking line solved my headache:
systemctl restart php-fpm
You need to check your php.ini and make sure it is loading the mbstring extension, or load it at runtime:
Here for the ini extension loading:
How do I configure php to enable pdo and include mysqli on CentOS?
Here for runtime loading
http://php.net/manual/en/function.dl.php
It's a known fact that on Fedora/RHEL/CentOS 7.x based systems PHP 5.4.16 is the supported version. However, for my application I needed PHP 5.5 and I installed it from RHEL-recommended scl-utils repository as explained on https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Developer_Guide/scl-utils.html
The problem is that I have successfully installed all required packages except php55-php-mcrypt:
yum install php55-php-mcrypt
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.sonic.net
* epel: mirror.hmc.edu
* extras: mirror.keystealth.org
* updates: mirrors.easynews.com
No package php55-php-mcrypt available.
Error: Nothing to do
Could anyone recommend a way to get this package installed?
Explanation why "mcrypt" is a very bad idea, and is not part of standard repository : About libmcrypt and php-mcrypt
For people who want to use the official RHSCL packages on RHEL (which is also available in centos-scl repository), you can find additional packages in the community repositories:
php55 => php55more
rh-php56 => php56more
Else, yes my repository is an alternative, see the Configuration Wizard
Switch to the Remi repo. It has 5.5, 5.6 and 7.0 available and they are supported as long as the PHP project supports them. Better still, he breaks that support into separate repos, so you pick the one you want and install the php-* RPMs. When you're ready to upgrade, enable the next repo and just yum update.
RPM of PHP version 7.0.2 are available in remi-php70 repository for Fedora and Enterprise Linux (RHEL, CentOS).
RPM of PHP version 5.6.17 are available in remi repository for Fedora ≥ 21 and remi-php56 repository for Fedora and Enterprise Linux.
RPM of PHP version 5.5.31 are available in remi repository for Fedora 20 and in remi-php55 repository for Enterprise Linux.
I have an unmanaged VPS server preinstalled with CentOs 6.6 and WHM/CPanel. I am trying to install php-ldap but it just says package not found. I have not been able to find anywhere what repository it should be in. How can I install ldap on my server to work with php 5.4? I am trying to manage Windows Server 2012 R2 Active Directory.
root#vps [~]# yum install php-ldap
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.5ninesolutions.com
* epel: fedora-epel.mirror.lstn.net
* extras: centos.arvixe.com
* updates: pubmirrors.dal.corespace.com
No package php-ldap available.
Error: Nothing to do
root#vps [~]#
On a cpanel serveur you probably have an "exclude" line in yum.conf (see I can't install any package related to PHP with yum) which prevent you to install/upgrade php from another repository.
To see the provider of "php", user this command
rpm -qf $(which php)
And the ldap extension, if available will be in the same namespace.
Notice switch the php stack from the cpanel provider to another repo can break it.
You need to understand that the base repos typically don't contain boutique builds for PHP. Your best bet is to install a different repo, like the Remi repo, which does contain that RPM.
While I'm at it, PHP 5.4 went End-of-life 4 days ago. Remi offers 5.5 and 5.6 so you should consider upgrading
Get the php version you are running by
php -v
if not worked try
rpm -qa |grep php
if the php version is 5.4 then use
sudo yum install php54w-ldap
if 5.6
sudo yum install php56w-ldap
and so on.