vestacp升级php,VestaCP安装php-5.2.7

centos6上的VestaCP都是支持在php5.4以上版本,但是有些老网站还是php5.2写的,为了支持这些老网站,研究了下VestaCP支持php5.2的方法

1.yum groupinstall ‘Development Tools’

2. yum install \

libxml2-dev* \

libmhash-dev* \

libcurl-dev* \

libpng* \

libjpeg* \

libtidy-dev* \

libxslt-dev* \

libtool-ltdl-dev* \

mcrypt \

libmcrypt-dev* \

libXpm-dev* \

libsqlite* \

mysql-dev* \

mysql-libs \

sqlite-dev* \

freetype-dev* \

openssl-dev* \

bzip2-dev* \

unzip* \

patch \

make \

gcc*

yum –enablerepo=remi,remi-test install mysql-devel

3.mkdir /opt/php-5.2.17

4. mkdir -p /usr/src/php/ && cd /usr/src/php/

5. wget -c -t0 http://museum.php.net/php5/php-5.2.17.tar.gz

6. tar zxf php-5.2.17.tar.gz

7. cd /usr/src/php/php-5.2.17/

8.wget http://php52-backports.googlecode.com/files/php52-backports-20130717.patch

9.patch -p1 < php52-backports-20130717.patch

./configure \

–prefix=/opt/php-5.2.17 \

–with-config-file-path=/opt/php-5.2.17 \

–with-libdir=lib64 \

–with-mysql \

–with-mysqli \

–with-sqlite=shared \

–with-curl \

–with-gd \

–with-openssl \

–with-pdo-mysql=shared –with-pdo-sqlite=shared \

–with-mcrypt \

–with-pear \

–with-pic \

–with-jpeg-dir \

–with-png-dir \

–with-ttf \

–with-freetype-dir \

–with-xmlrpc \

–with-xpm-dir \

–with-zlib \

–enable-bcmath \

–enable-calendar \

–enable-cli \

–enable-discard-path \

–enable-fastcgi \

–enable-ftp \

–enable-force-cgi-redirect \

–enable-gd-native-ttf \

–enable-libxml \

–enable-mbstring \

–enable-pdo=shared \

–enable-soap \

–enable-sockets \

–enable-session \

–enable-zip \

–enable-zend-multibyte

此步骤如果出现 Requires: mysql = 5.1.73-3.el6_5 这种错误,执行下面命令:

这个是编译php5.2.7的命令,如果是32位的 要换成 –with-libdir=lib

11. make && make install

12.cp /usr/src/php/php-5.2.17/php.ini-recommended /opt/php-5.2.17/lib/php.ini

13./opt/php-5.2.17/bin/php-cgi -v

14. vi /usr/local/vesta/data/templates/web/httpd/phpfcgid_52.sh

写入如下内容:

#!/bin/bash

# Adding php wrapper

user=”$1″

domain=”$2″

ip=”$3″

home_dir=”$4″

docroot=”$5″

wrapper_script=”#!/bin/sh

export PHPRC=/opt/php-5.2.17/lib/

export PHP_FCGI_MAX_REQUESTS=1000

export PHP_FCGI_CHILDREN=20

exec /opt/php-5.2.17/bin/php-cgi

wrapper_file=”$home_dir/$user/web/$domain/cgi-bin/fcgi-starter”

echo “$wrapper_script” > $wrapper_file

chown $user:$user $wrapper_file

chmod -f 751 $wrapper_file

exit 0

15. vi /usr/local/vesta/data/templates/web/httpd/phpfcgid_52.tpl

写下如下内容:

ServerName %domain_idn%

%alias_string%

ServerAdmin %email%

DocumentRoot %docroot%

ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/

Alias /vstats/ %home%/%user%/web/%domain%/stats/

Alias /error/ %home%/%user%/web/%domain%/document_errors/

SuexecUserGroup %user% %group%

CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes

CustomLog /var/log/%web_system%/domains/%domain%.log combined

ErrorLog /var/log/%web_system%/domains/%domain%.error.log

AllowOverride All

Options +Includes -Indexes +ExecCGI

SetHandler fcgid-script

FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php

AllowOverride All

Include %home%/%user%/conf/web/%web_system%.%domain%.conf*

16. vi /usr/local/vesta/data/templates/web/httpd/phpfcgid_52.stpl

写下如下内容:

ServerName %domain_idn%

%alias_string%

ServerAdmin %email%

DocumentRoot %sdocroot%

ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/

Alias /vstats/ %home%/%user%/web/%domain%/stats/

Alias /error/ %home%/%user%/web/%domain%/document_errors/

SuexecUserGroup %user% %group%

CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes

CustomLog /var/log/%web_system%/domains/%domain%.log combined

ErrorLog /var/log/%web_system%/domains/%domain%.error.log

SSLRequireSSL

AllowOverride All

Options +Includes -Indexes +ExecCGI

SetHandler fcgid-script

FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php

AllowOverride All

php_admin_value open_basedir none

SSLEngine on

SSLVerifyClient none

SSLCertificateFile %ssl_crt%

SSLCertificateKeyFile %ssl_key%

%ssl_ca_str%SSLCertificateChainFile %ssl_ca%

Include %home%/%user%/conf/web/s%web_system%.%domain%.conf*

17.安装完成,执行下面命令

chmod +x /usr/local/vesta/data/templates/web/httpd/phpfcgid_52.sh && \

chmod +x /usr/local/vesta/data/templates/web/httpd/phpfcgid_52.tpl && \

chmod +x /usr/local/vesta/data/templates/web/httpd/phpfcgid_52.stpl

service httpd restart

18.再登录vestacp的后台,添加网站。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引入一个依赖后,启动springboot报错:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultValidator' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.hibernate.validator.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider; at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:893) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
最新发布
06-08

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值