简体   繁体   English

CentOS 5-安装PHP intl

[英]CentOS 5 - Install PHP intl

Server: 服务器:

  • CENTOS 5.11 i686 CENTOS 5.11 i686
  • WHM 54.0 WHM 54.0

I've tried several approaches installing intl PHP extension. 我尝试了几种安装intl PHP扩展的方法。


First approach is straight forward. 第一种方法很简单。
In WHM i enter PHP PECL, and when trying to install intl : 在WHM中,我输入PHP PECL,并在尝试安装intl

 downloading intl-3.0.0.tgz ...
 Starting to download intl-3.0.0.tgz (248,200 bytes)
....................................................done: 248,200 bytes
 150 source files, building
 running: phpize
 Configuring for:
 PHP Api Version:         20121113
 Zend Module Api No:      20121212
 Zend Extension Api No:   220121212
 Specify where ICU libraries and headers can be found [DEFAULT] : building in /root/tmp/pear/pear-build-rootnuhZM5/intl-3.0.0
 running: /root/tmp/pear/intl/configure --with-php-config=/usr/local/bin/php-config --with-icu-dir=DEFAULT
 checking for egrep... grep -E
 checking for a sed that does not truncate output... /bin/sed
 checking for cc... cc
 checking for C compiler default output file name... a.out
 checking whether the C compiler works... yes
 checking whether we are cross compiling... no
 checking for suffix of executables...
 checking for suffix of object files... o
 checking whether we are using the GNU C compiler... yes
 checking whether cc accepts -g... yes
 checking for cc option to accept ANSI C... none needed
 checking how to run the C preprocessor... cc -E
 checking for icc... no
 checking for suncc... no
 checking whether cc understands -c and -o together... yes
 checking for system library directory... lib
 checking if compiler supports -R... no
 checking if compiler supports -Wl,-rpath,... yes
 checking build system type... i686-pc-linux-gnu
 checking host system type... i686-pc-linux-gnu
 checking target system type... i686-pc-linux-gnu
 checking for PHP prefix... /usr/local
 checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
 checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20121212
 checking for PHP installed headers prefix... /usr/local/include/php
 checking if debug is enabled... no
 checking if zts is enabled... no
 checking for re2c... re2c
 checking for re2c version... invalid
 configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
 checking for gawk... gawk
 checking whether to enable internationalization support... yes, shared
 checking for icu-config... /usr/bin/icu-config
 checking for location of ICU headers and libraries... /usr
 checking for ICU 4.0 or greater... found 3.6
 configure: error: ICU version 4.0 or later is required
 ERROR: `/root/tmp/pear/intl/configure --with-php-config=/usr/local/bin/php-config --with-icu-dir=DEFAULT' failed
 The intl.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20121212
 Tidying /usr/local/lib/php.ini...
 No changes
 Tidying /usr/local/cpanel/3rdparty/php/54/etc/php.ini...
 No changes

Tried finding that intl.so object manually online, no luck. 试图找到intl.so object手动在线,没有运气。
I'm afraid I might get non-compatible version and screw things up. 恐怕我会得到不兼容的版本并搞砸了。 Nonetheless, this would be a bad solution. 尽管如此,这将是一个糟糕的解决方案。


Second approach is running pecl library via ssh : 第二种方法是通过ssh运行pecl库:

root@ns1 [/]# /usr/bin/pecl install intl

and the response: 和响应:

downloading intl-3.0.0.tgz ...
Starting to download intl-3.0.0.tgz (248,200 bytes)
....................................................done: 248,200 bytes
could not extract the package.xml file from "/root/tmp/pear/cache/intl-3.0.0.tgz"
Download of "pecl/intl" succeeded, but it is not a valid package archive
Error: cannot download "pecl/intl"
Download failed
install failed

Researching online, I tried to update icu via yum . 在线研究时,我尝试通过yum更新icu
It finds php53-intl.i386 package and says it's already installed. 它找到php53-intl.i386软件包,并说它已经安装。

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.spd.co.il
 * extras: centos.spd.co.il
 * updates: centos.spd.co.il
Excluding Packages in global exclude list
Finished
Installed Packages
php53-intl.i386

PHP was excluded in the config, and I had to remove it from the list. PHP被排除在配置之外,我不得不将其从列表中删除。 I wonder why, in addition when I yum list php 我不知道为什么,除了当我yum list php

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.spd.co.il
 * extras: centos.spd.co.il
 * updates: centos.spd.co.il
Excluding Packages in global exclude list
Finished
Available Packages
php.i386                   5.1.6-45.el5_11                                                                                                                    updates

And php -v says PHP 5.5.31 (cli) (built: Jan 14 2016 18:46:05) php -v表示PHP 5.5.31 (cli) (built: Jan 14 2016 18:46:05)
This also might be useful, rpm -qa | grep php rpm -qa | grep php这也可能有用rpm -qa | grep php rpm -qa | grep php response: rpm -qa | grep php响应:

cpanel-php54-Horde-Auth-2.1.8-4.cp1152
cpanel-php54-Horde-Compress-2.1.2-5.cp1152
cpanel-php54-Horde-Argv-2.0.11-4.cp1152
cpanel-php54-Horde-Secret-2.0.4-4.cp1152
cpanel-php54-Horde-Service-Twitter-2.1.1-4.cp1152
cpanel-php54-SOAP-0.13.0-4.cp1152
cpanel-php54-Date-Holidays-Denmark-0.1.3-4.cp1152
cpanel-php54-Horde-CssMinify-1.0.2-4.cp1152
cpanel-php54-Cache-1.5.6-4.cp1152
cpanel-php54-HTML-Template-IT-1.3.0-4.cp1152
cpanel-php54-Horde-Prefs-2.7.3-4.cp1152
cpanel-php54-Horde-Itip-2.1.0-4.cp1152
cpanel-php54-Horde-Serialize-2.0.3-4.cp1152
cpanel-php54-Horde-Css-Parser-1.0.6-4.cp1152
cpanel-php54-Horde-Support-2.1.3-4.cp1152
cpanel-php54-Horde-Constraint-2.0.2-4.cp1152
cpanel-php54-Horde-Service-Facebook-2.0.5-4.cp1152
cpanel-php54-Date-Holidays-Brazil-0.1.2-4.cp1152
cpanel-php54-Date-Holidays-Venezuela-0.1.1-4.cp1152
cpanel-php54-HTTP-1.4.1-4.cp1152
cpanel-php54-Text-Figlet-1.0.2-4.cp1152
cpanel-php54-Horde-Smtp-1.9.1-4.cp1152
cpanel-php54-Horde-ListHeaders-1.2.2-4.cp1152
cpanel-php54-Horde-Injector-2.0.4-4.cp1152
cpanel-php54-Horde-Image-2.3.1-4.cp1152
cpanel-php54-XML-Parser-1.3.4-4.cp1152
cpanel-php54-Horde-Kolab-Format-2.0.4-4.cp1152
cpanel-php54-Date-Holidays-Spain-0.1.3-4.cp1152
cpanel-php54-Date-Holidays-Iceland-0.1.2-4.cp1152
cpanel-php54-Console-Table-1.1.5-4.cp1152
cpanel-php54-MDB2-2.4.1-4.cp1152
cpanel-php54-trean-1.1.1-5.cp1152
cpanel-php54-zendopt-6.0.0-1.cp1142
cpanel-php54-Horde-Translation-2.2.0-4.cp1152
cpanel-php54-Horde-Stream-Filter-2.0.3-4.cp1152
cpanel-php54-Horde-Routes-2.0.2-4.cp1152
cpanel-php54-Horde-Oauth-2.0.1-4.cp1152
cpanel-php54-Mail-1.2.0-4.cp1152
cpanel-php54-Date-Holidays-Ireland-0.1.3-4.cp1152
cpanel-php54-Date-Holidays-Croatia-0.1.1-4.cp1152
cpanel-php54-Horde-Mail-2.6.0-4.cp1152
cpanel-php54-nag-4.2.4-7.cp1152
cpanel-php54-Horde-Browser-2.0.9-4.cp1152
cpanel-php54-Horde-Cache-2.5.0-4.cp1152
cpanel-php54-Horde-View-2.0.5-4.cp1152
cpanel-php54-Horde-Log-2.1.2-4.cp1152
cpanel-php54-Horde-Feed-2.0.1-4.cp1152
cpanel-php54-Date-Holidays-Finland-0.1.2-4.cp1152
cpanel-php54-Date-Holidays-USA-0.1.1-4.cp1152
cpanel-php54-Horde-Pack-1.0.5-4.cp1152
cpanel-php54-Horde-Core-2.20.2-4.cp1152
cpanel-php54-Horde-Crypt-2.5.3-4.cp1152
cpanel-php54-Horde-Socket-Client-2.0.0-5.cp1152
cpanel-php54-Horde-Autoloader-2.1.1-4.cp1152
cpanel-php54-Horde-Xml-Element-2.0.3-4.cp1152
cpanel-php54-Horde-Perms-2.1.4-4.cp1152
cpanel-php54-Horde-Queue-1.1.2-4.cp1152
cpanel-php54-Horde-Kolab-Session-2.0.1-4.cp1152
cpanel-php54-Date-Holidays-Japan-0.1.2-4.cp1152
cpanel-php54-Date-Holidays-Italy-0.1.1-4.cp1152
cpanel-php54-Horde-Idna-1.0.3-4.cp1152
cpanel-php54-PEAR-Command-Packaging-0.3.0-4.cp1152
cpanel-php54-Horde-Dav-1.1.2-4.cp1152
cpanel-php54-Horde-Yaml-2.0.2-4.cp1152
php53-common-5.3.3-26.el5_11
cpanel-php54-Horde-Exception-2.0.5-4.cp1152
cpanel-php54-Net-Socket-1.0.14-4.cp1152
cpanel-php54-Horde-SpellChecker-2.1.2-4.cp1152
cpanel-php54-Horde-Cli-2.0.6-4.cp1152
cpanel-php54-Net-URL-1.0.15-4.cp1152
cpanel-php54-Net-DNS2-1.4.1-4.cp1152
cpanel-php54-Date-Holidays-Serbia-0.1.0-4.cp1152
cpanel-php54-Date-Holidays-Germany-0.1.2-4.cp1152
cpanel-php54-Console-Color-1.0.3-4.cp1152
cpanel-php54-Horde-Icalendar-2.0.11-4.cp1152
cpanel-php54-turba-4.2.6-6.cp1152
cpanel-php54-Horde-Imap-Client-2.28.1-4.cp1152
cpanel-php54-Horde-Group-2.0.5-4.cp1152
cpanel-php54-Horde-Vfs-2.2.2-4.cp1152
cpanel-php54-Horde-Text-Flowed-2.0.2-4.cp1152
cpanel-php54-Horde-Xml-Wbxml-2.0.1-4.cp1152
cpanel-php54-Horde-History-2.3.4-4.cp1152
cpanel-php54-Horde-SessionHandler-2.2.4-4.cp1152
cpanel-php54-horde-lz4-1.0.8-2.cp1152
cpanel-php54-Horde-Pdf-2.0.3-4.cp1152
cpanel-php54-Services-Weather-1.4.7-4.cp1152
cpanel-php54-Date-Holidays-Romania-0.1.2-4.cp1152
cpanel-php54-Date-Holidays-Slovenia-0.1.2-4.cp1152
cpanel-php54-Date-Holidays-PHPdotNet-0.1.2-4.cp1152
cpanel-php54-Horde-JavascriptMinify-1.1.2-4.cp1152
cpanel-php54-Net-FTP-1.3.7-4.cp1152
cpanel-php54-XML-SVG-1.1.0-4.cp1152
cpanel-php54-horde-5.2.5-13.cp1152
cpanel-php54-Horde-Timezone-1.0.9-4.cp1152
cpanel-php54-webmail-5.2.6-6.cp1152
cpanel-php54-Horde-Token-2.0.6-4.cp1152
cpanel-php54-Date-1.4.7-4.cp1152
cpanel-php54-Horde-Share-2.0.7-4.cp1152
cpanel-php54-Horde-HashTable-1.2.3-4.cp1152
cpanel-php54-Date-Holidays-Australia-0.2.1-4.cp1152
cpanel-php54-Date-Holidays-SanMarino-0.1.1-4.cp1152
cpanel-php54-Log-1.12.7-4.cp1152
cpanel-php54-File-Fstab-2.0.3-4.cp1152
cpanel-php54-Horde-Rpc-2.1.4-4.cp1152
cpanel-php54-Horde-Mail-Autoconfig-1.0.2-4.cp1152
cpanel-php54-5.4.31-4.cp1150
cpanel-php54-Horde-Role-1.0.1-5.cp1152
cpanel-php54-Horde-Notification-2.0.2-4.cp1152
cpanel-php54-Horde-Lock-2.1.1-4.cp1152
cpanel-php54-XML-Serializer-0.20.2-4.cp1152
cpanel-php54-Horde-Imsp-2.0.5-4.cp1152
cpanel-php54-Date-Holidays-Norway-0.1.2-4.cp1152
cpanel-php54-Date-Holidays-UNO-0.1.3-4.cp1152
cpanel-php54-ingo-3.2.5-6.cp1152
cpanel-php54-Horde-Text-Filter-2.3.1-4.cp1152
cpanel-php54-Horde-Compress-Fast-1.1.0-4.cp1152
cpanel-php54-Horde-Stream-Wrapper-2.1.2-4.cp1152
cpanel-php54-Horde-Template-2.0.2-4.cp1152
cpanel-php54-Horde-ElasticSearch-1.0.2-4.cp1152
cpanel-php54-Date-Holidays-Netherlands-0.1.3-4.cp1152
cpanel-php54-Date-Holidays-Turkey-0.1.1-4.cp1152
cpanel-php54-Auth-SASL-1.0.6-4.cp1152
cpanel-php54-Horde-Mime-Viewer-2.1.0-4.cp1152
cpanel-php54-kronolith-4.2.7-7.cp1152
php53-intl-5.3.3-26.el5_11
cpanel-php54-Horde-Nls-2.0.5-4.cp1152
cpanel-php54-Horde-Alarm-2.2.4-4.cp1152
cpanel-php54-Horde-Http-2.1.5-4.cp1152
cpanel-php54-Horde-Controller-2.0.3-4.cp1152
cpanel-php54-Net-IMAP-1.1.2-4.cp1152
cpanel-php54-Date-Holidays-Portugal-0.1.0-4.cp1152
cpanel-php54-Date-Holidays-Sweden-0.1.3-4.cp1152
cpanel-php54-Net-Sieve-1.3.2-4.cp1152
cpanel-php54-File-Find-1.3.2-4.cp1152
cpanel-php54-Horde-Form-2.0.9-4.cp1152
cpanel-php54-imp-6.2.8-6.cp1152
cpanel-php54-Horde-Util-2.5.5-4.cp1152
cpanel-php54-Horde-LoginTasks-2.0.4-4.cp1152
cpanel-php54-Horde-Editor-2.0.4-4.cp1152
cpanel-php54-Horde-Date-Parser-2.0.4-4.cp1152
cpanel-php54-Date-Holidays-0.21.8-4.cp1152
cpanel-php54-Mail-Mime-1.8.3-4.cp1152
cpanel-php54-Date-Holidays-Austria-0.1.5-4.cp1152
cpanel-php54-Date-Holidays-Russia-0.1.0-4.cp1152
cpanel-php54-DB-1.7.14-4.cp1152
cpanel-php54-Net-UserAgent-Detect-2.5.2-4.cp1152
cpanel-php54-Horde-Mime-2.9.1-4.cp1152
cpanel-php54-mnemo-4.2.6-4.cp1152
cpanel-php54-ioncube-4.5.2-1.cp1142
cpanel-php54-Horde-Url-2.2.4-4.cp1152
cpanel-php54-Horde-Stream-1.6.2-4.cp1152
cpanel-php54-Horde-Text-Diff-2.1.1-4.cp1152
cpanel-php54-Horde-Crypt-Blowfish-1.0.3-4.cp1152
cpanel-php54-HTTP-Request-1.4.4-4.cp1152
cpanel-php54-Date-Holidays-Czech-0.1.0-4.cp1152
cpanel-php54-HTTP-WebDAV-Server-1.0.0RC8-4.cp1152
cpanel-php54-XML-RPC-1.5.5-4.cp1152
cpanel-php54-Horde-Data-2.1.2-4.cp1152
cpanel-php54-timeobjects-2.1.0-4.cp1152
cpanel-php54-sourceguardian-8.3-1.cp1142
cpanel-php54-Horde-Date-2.1.0-4.cp1152
cpanel-php54-Horde-Tree-2.0.4-4.cp1152
cpanel-php54-Horde-Db-2.2.3-4.cp1152
cpanel-php54-Horde-Rdo-2.0.4-4.cp1152
cpanel-php54-Net-SMTP-1.6.2-4.cp1152
cpanel-php54-Date-Holidays-EnglandWales-0.1.5-4.cp1152
cpanel-php54-Date-Holidays-Ukraine-0.1.2-4.cp1152
cpanel-php54-File-1.4.1-4.cp1152
cpanel-php54-content-2.0.4-5.cp1152
cpanel-php54-Horde-SyncMl-2.0.3-4.cp1152

I am lost here. 我在这里迷路了。

Since you're already using EasyApache, you can install the Intl extension within EasyApache (not through the WHM PHP Extension install area), which I would recommend. 由于您已经在使用EasyApache,因此可以在EasyApache中安装Intl扩展(不建议通过WHM PHP Extension安装区域)。 EasyApache is very sensitive to outside modifications/changes due to the nature of the script :) 由于脚本的性质,EasyApache对外部修改/更改非常敏感:)

WHM 54.0 build 12 Easy Apache v3.32.10 WHM 54.0 build 12 Easy Apache v3.32.10

  • Go to EasyApache3 in WHM 在WHM中转到EasyApache3
  • Under "cPanel Recommended Profiles" next to "Basic Apache 2.4" click on the gear icon to customize this profile 在“基本Apache 2.4”旁边的“ cPanel推荐的配置文件”下,点击齿轮图标以自定义此配置文件
  • Step 1: Keep Apache 2.4 (unless you absolutely need Apache 2.2) 步骤1:保留Apache 2.4(除非您绝对需要Apache 2.2)
  • Step 2: Select your PHP version, I recommend php 5.5 or 5.6 depending on application requirements 第2步:选择您的PHP版本,我建议根据应用程序要求使用PHP 5.5或5.6
  • Step 3: Usually the default settings here are sufficient, but the next click the "Exhaustive Options List" button 步骤3:通常,这里的默认设置就足够了,但是接下来单击“详尽选项列表”按钮
  • Step 4: You can skip the "Apache" modules section, the "PHP Modules" section is about 50% down the page. 步骤4:您可以跳过“ Apache”模块部分,“ PHP模块”部分在页面下方大约50%。 Select any PHP modules you need (including Intl) add-on together. 一起选择您需要的任何PHP模块(包括Intl)插件。 You can also leave the rest default as well. 您也可以将其余的保留为默认值。
  • Click "Save & Build" 点击“保存并构建”

If you run into any errors during the build process I highly recommend you contact cPanel support or your server provider if you have technical assistance. 如果在构建过程中遇到任何错误,我强烈建议您与cPanel支持或服务器提供商联系,如果您有技术帮助。 Most all of the plugins you need for PHP are installable via EasyApache and it is the safest way to install them. PHP所需的大多数插件都可以通过EasyApache安装,这是安装它们的最安全方法。

If you tried this already, use a fresh "cPanel Recommended Profile" and be sure to only check the minimum required options, as some addons might not be compatible with others in some cases. 如果您已经尝试过此操作,请使用全新的“ cPanel推荐配置文件”,并确保仅检查所需的最低限度选项,因为某些插件在某些情况下可能与其他插件不兼容。

Starting fresh generally works for me when I am having issues with EasyApache. 当EasyApache出现问题时,重新开始通常对我有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM