programing

CentOS 6.2에 PHP mbstring을 설치하는 방법

kingscode 2021. 1. 18. 08:11
반응형

CentOS 6.2에 PHP mbstring을 설치하는 방법


CentOS 6.2에서 PHP로 mbstring을 설치하는 방법

난 노력 했어:

$ 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

그러나 패키지가 발견되지 않았습니까?


다음을 수행하십시오.

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

섹션 아래에서 updatesmirrorlist 줄을 주석 처리하고 (줄 #앞에 a를 입력) 새 줄에 다음을 작성합니다.

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

이제 시도해보십시오.

yum install php-mbstring

(나중에 미러리스트의 주석 처리를 제거하고 baseurl에 주석을 달고 싶을 것입니다)


cPanel 호스팅이있는 경우 Easy Apache를 사용하여 쉘을 통해이 작업을 수행 할 수 있습니다. 다음은 단계입니다.

  1. Easy Apache 경로를 입력하십시오. Easy Apache의 경로를 입력하십시오.

    root @ vps #### [~] # / scripts / easyapache

  2. "cPanel 업데이트 사용 가능"에 예라고 말하지 마십시오.
  3. "전체 옵션 목록"이 나올 때까지 기본값으로 화면을 계속 진행합니다.
  4. Mbstring 확장이 나열 될 때까지 아래로 내려가 선택하십시오.
  5. 단계를 계속 진행하고 Apache PHP 빌드를 저장합니다.

Apache와 PHP는 이제 mbstring 확장을 포함하도록 다시 빌드됩니다. 프로세스가 완료 될 때까지 10 ~ 30 분 정도 기다립니다. 프로세스가 완료되면 이제 phpinfo에서 Mbstring 확장을 볼 수 있습니다.

자세한 단계 는 Easy Apache로 mbstring 확장 설치 기사를 참조하십시오.


/etc/yum.conf파일을 확인하십시오 php. 패키지 제외 일 수 있습니다.

패키지 php*를 다운로드 할 수 있도록이 줄에서 제거해야 php-*합니다.

exclude= courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* php*

서버에 cPanel과 같은 스크립트가있는 것 같습니다.


* 먼저 리눅스 박스를 업데이트해야합니다.

yum update

누군가가 여전히이 문제를 가지고 있다면 이것은 유효한 해결책입니다.

centos-release : rpm -q centos-release

Centos 6. *

wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm

Centos 5. *

wget http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -ivh epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm

그런 다음 다음을 수행하여 업데이트하십시오 .

yum --enablerepo=remi upgrade php-mbstring

또는 이것을 설치하십시오 :

yum --enablerepo=remi install php-mbstring

  1. PHP 버전 찾기- php -v
  2. 사용 가능한 PHP 확장 검색- yum search php-
  3. 다음을 사용하여 설치- yum install ea-php56-php-mbstring.x86_64
  4. 그때 httpd -k restart

패키지 이름-ea-php-php-mbstring.x86_64


yum install php-mbstring ( http://php.net/manual/en/mbstring.installation.php에 따라 )

EPEL 저장소 http://fedoraproject.org/wiki/EPEL 을 설치해야한다고 생각합니다.


으로 yum install php-mbstring다음 httpd -k restart나를 위해 그것을하지 않았다, 나는 생각 이 옵션이 설명 된대로, 컴파일해야 여기 :

이제 PHP를 구성하고 빌드하십시오. 여기에서 어떤 확장을 사용할 것인지와 같은 다양한 옵션으로 PHP를 사용자 정의 할 수 있습니다. 사용 가능한 옵션 목록을 보려면 ./configure --help를 실행하십시오. 이 예에서는 Apache 2 및 MySQL 지원으로 간단한 구성을 수행합니다.

If you built Apache from source, as described above, the below example will match your path for apxs, but if you installed Apache some other way, you'll need to adjust the path to apxs accordingly. Note that some distros may rename apxs to apxs2.

cd ../php-NN
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-mbstring
make
make install

If you decide to change your configure options after installation, you'll need to re-run the configure, make, and make install steps. You only need to restart apache for the new module to take effect. A recompile of Apache is not needed.

Note that unless told otherwise, 'make install' will also install PEAR, various PHP tools such as phpize, install the PHP CLI, and more.

Though this page says it's optional:

--enable-mbstring Allows multibyte character string support. This is optional, as slower custom code will be used if not available.


None of above works for godaddy 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


I have experienced the same issue before. In my case, I needed to install php-mbstring extension on GoDaddy VPS server. None of above solutions did work for me.

What I've found is to install PHP extensions using WHM (Web Hosting Manager) of GoDaddy. Anyone who use GoDaddy VPS server can access this page with the following address.

http://{Your_Server_IP_Address}:2087

On this page, you can easily find Easy Apache software that can help you to install/upgrade php components and extensions. You can select currently installed profile and customize and then provision the profile. Everything with Easy Apache is explanatory.

I remember that I did very similar things for HostGator server, but I don't remember how actually I did for profile update.

Edit: When you have got the server which supports Web Hosting Manager, then you can add/update/remove php extensions on WHM. On godaddy servers, it's even recommended to update PHP ini settings on WHM.


If none of the above help you out, and you have the option, try obtaining one of the rpm files eg:

wget http://rpms.famillecollet.com/enterprise/6/remi/x86_64/php-mbstring-5.4.45-2.el6.remi.x86_64.rpm

then using rpm, install it ignoring the depenecies like so:

rpm -i --nodeps php-mbstring-5.4.45-2.el6.remi.x86_64.rpm

Hope that helps out.


sudo yum install php<version>w-mbstring

ex. sudo yum install php56w-mbstring

ReferenceURL : https://stackoverflow.com/questions/10278561/how-to-install-php-mbstring-on-centos-6-2

반응형