webmin升级php,如何给webmin/virtualmin安装不同版本的PHP,安装php5.4

如何给webmin/virtualmin安装不同版本的PHP,安装php5.4

Introduction

Beginning in Virtualmin 3.99, if you have multiple PHP versions installed, you can choose which version to use for a given domain, or even per-directory.

While this feature can work with any Operating System version, it works best with CentOS 5 and 6 using the Software Collections repository.

Installing a second PHP Version on CentOS 5 or 6

CentOS supports something called "Software Collections", which is a system for installing multiple software versions on one server. Using packages provided by a third party in the Software Collections repository, it's possible to install PHP 5.4 in /opt/, while keeping your current PHP version installed in /usr/.

To install PHP 5.4 from the Software Collections repository, you perform the following steps:

Log into your server over SSH as root

Download the .repo file by running the commandwget -O /etc/yum.repos.d/software_collections_php54.repo http://people.redhat.com/rcollet/php54/rhel-php54.repo

Install PHP 5.4 and scl-utils with this command:yum install php54 php54-php-cli php54-php-mysql php54-php-gd

Configuring the second PHP Version in Virtualmin

Once you have completed the installation of a second PHP version, you can verify that Virtualmin sees it by logging into Virtualmin, and clicking System Settings -> Re-Check Config. You should see something like this:

The following PHP versions are available : 5.3.3 (/usr/bin/php-cgi), 5.4.11 (/opt/rh/php54/root/usr/bin/php-cgi)

You can configure which one is the default PHP version used on new Virtual Servers. The default is to use the newest available. You can change that default in System Settings -> Server Templates -> Default -> Apache Website, and on that screen you can set the default PHP version to use in the fieldDefault PHP version.

Configuring Individual Virtual Servers

You can configure the PHP version being used for a specific Virtual Server by selecting Server Configuration -> PHP Versions.

The first line there specifies what PHP version will be used by default.

If you wish, you can specify a different PHP version to be used for a specific directory.

安装常用php组件

yum --enablerepo=php54 install php54-php-curl php54-php-xml php54-php-dom php54-php-mcrypt php54-php-gd php54-php-mbstring php54-php-mhash php54-php-pdo php54-php-soap php54-php-snmp php54-php-odbc php54-php-imap

如果发现mysql不能连接,参考下面:

[warn] mod_fcgid: stderr: PHP Warning:  mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('www.ctohome.com'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值