系统环境:
Centos 6.3 X64
首先把AMH 4.2安装包下载到系统中
1 |
wget http://amh.sh/file/AMH/4.2/amh.sh |
我们以php 5.5.11为例。
vi amh.sh
1.将 PhpVersion=’php-5.3.27’; 改为 PhpVersion=’php-5.5.11’; 其中,版本号可以根据最新的版本来定。其实 PHP 官方也是推荐 5.3 更新到 5.3.28 的,不过 A大 不在就没有更新过,貌似 A大 更加关心 Nginx 的漏洞。
2.找到 function InstallPhp() 函数,我们来修改安装内容,将
1 |
Downloadfile "${PhpVersion}.tar.gz" "http://code.amysql.com/files/${PhpVersion}.tar.gz"; |
改为
1 |
Downloadfile "${PhpVersion}.tar.gz" "http://us2.php.net/distributions/${PhpVersion}.tar.gz"; |
注:国内地址就把us2改成cn2
3.这次我们还要编译参数也折腾一下,因为 AMH 目前的 PHP 模块不支持 5.3 以外的拓展,不过我们还可以在安装的时候就折腾好自己想要的,不过需要一定的技术能力。
1 |
./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-openssl --with-zlib --with-curl --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --enable-zip --with-iconv=/usr/local/libiconv --with-mysql=/usr/local/mysql --without-pear $PHPDisable; |
这这就默认的编译内容很精炼,虽然这样子功能少了但是稳定性是很有保证的,其他需要的模块安装,这次我加上必要的模块。
1 |
./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-openssl --with-zlib --with-curl --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --enable-zip --with-iconv=/usr/local/libiconv --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql/bin/mysql_config --without-pear $PHPDisable; |
这里加入了 mysqli 和 pdo_mysql 模块。
转载自:米饭吧
文章评论