Asked  7 Months ago    Answers:  5   Viewed   44 times

How do I install mbstring with PHP on CentOS 6.2

I've tried:

$ sudo yum install php-mbstring

Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.net.cen.ct.gov
 * extras: centos.aol.com
 * updates: mirrors.seas.harvard.edu
Setting up Install Process
No package php-mbstring available.
Error: Nothing to do

But no packages were found?

 Answers

30

do the following:

sudo nano /etc/yum.repos.d/CentOS-Base.repo

under the section updates, comment out the mirrorlist line (put a # in front of the line), then on a new line write:

baseurl=http://centos.intergenia.de/$releasever/updates/$basearch/

now try:

yum install php-mbstring

(afterwards you'll probably want to uncomment the mirrorlist and comment out the baseurl)

Wednesday, March 31, 2021
 
pwaring
answered 7 Months ago
81

php-* are base packages, 1 repository per version

  • "remi" => php 5.4
  • "remi-php55" => php 5.5
  • "remi-php56" => php 5.6
  • "remi-php70" => php 7.0 (Release Candidate, not ready for prod)

php56-* packages are Software Collections, parallel installation allowing to run multiple versions of PHP.

See : http://blog.remirepo.net/pages/English-FAQ

So, if you only want a single php version 5.6

yum --enablerepo=remi-php56 install php-cli (and other needed modules)

And you can also enable the repository for future update (as the "remi-php56" is safe and only provides php 5.6 and its extension)

yum-config-manager --enable remi-php56
Wednesday, March 31, 2021
 
TheFrack
answered 7 Months ago
21

Try Justin's solution first with pecl (you'll want to use yum rather than aptitude to install php-devel), but if that doesn't work, I happen to have the manual build procedures on hand already for my own deploy reference. :)

Installing the PHP MongoDB driver

As root:

  1. export PHP_AUTOCONF=/usr/bin/autoconf
  2. export PHP_AUTOHEADER=/usr/bin/autoheader
  3. wget http://pecl.php.net/get/mongo-1.0.9.tgz
  4. tar -xzf mongo-1.0.9.tgz
  5. cd mongo-1.0.9
  6. phpize
  7. ./configure
  8. make && make install
  9. To /etc/php.d/mongo.ini, add: extension=mongo.so
Wednesday, March 31, 2021
 
pwaring
answered 7 Months ago
76

You just need to install ClamAV like normal (with the epel repo)...

yum install clamav
yum install clamav-devel

If you don't have EPEL you can get it from IUS community (if you want you can also grab the IUS repo and get the latest version of PHP) - thank the RackSpace engineers for this!

wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/epel-release-6-5.noarch.rpm
rpm -ivh epel-release-6-5.noarch.rpm

Then you download and install this library, which will handle all the hard things for you.

wget **the direct link you got**
tar -xvzf php-clamav_0.15.7.tar.gz
cd php-clamav-0.15.7
phpize
./configure
make
make install

Now add the extension to your /etc/php.ini

extension=/usr/lib64/php/modules/clamav.so

Remember to change the path to what was given to you by make install

then restart your Apache

service httpd restart

Make a file with the contents:

<?php
    echo cl_info();

It should come up with something like this:

Now you should have access to all the library functions, you can now scan files like this:

$retcode = cl_scanfile($file, $virus_name);

if ($retcode === CL_VIRUS)
{
    echo "Virus Detected! {$virus_name}";
}

Congratulations! You can find other functions here

Friday, May 28, 2021
 
steros
answered 5 Months ago
25

Please read the Wizard instructions

If you need a single version, using remi-php72 repository, and the php-* packages, the command will be php.

# yum-config-manager --enable remi-php72
# yum update
# yum install php-cli
# php -v

If you need multiples versions, the php72-php-* packages are available, and the command is php72 or

# yum install php72-php-cli
# php72 -v
# scl enable php72 bash
# php -v

So, according to your question, you have enable the remi-php72 repository, but installed the php72* packages from the remi-safe repository...

Saturday, May 29, 2021
 
superfell
answered 5 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :