php版本升级

wordpress提示php版本升级

php-v查看版本

更新yum源
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum remove php*
yum install php71w php71w-cli php71w-common php71w-devel php71w-embedded php71w-fpm php71w-gd php71w-mbstring php71w-mysqlnd php71w-opcache php71w-pdo php71w-xml php71w-ldap php71w-mcrypt

71w改为72w

启动php和httpd

service php-fpm start
service httpd restart

修改wordpress上传图片的大小限制

上传个图片,提示“wordpress 此文件超过了本站点的最大上传尺寸”。怎么解决呢,咋能难倒老孙呢。

修改文件上传的文件大小参数
upload_max_filesize 即可。

find / -name php.ini
vi php.ini
/upload_max[回车]会直接定位到文件位置,修改一下,我改到了5m
保存退出
然后重启一下httpd
service httpd restart
即可

自定义异常

异常基类:

package combiz.exception;
public class BusinessException extends Exception {
     protected String msg ;
     private static final long serialVersionUID = 1L;
     public String getMessage() {
         return msg;
     }
}

主体异常:业务系统主体信息报错异常

package combiz.exception;
public class SubjectException extends BusinessException{
private static final long serialVersionUID = 1L;
}

主体未找到异常

package combiz.exception;
public class SubjectNotFoundException extends SubjectException{
    private static final long serialVersionUID = 1L;
}

企业信息未找到异常

package combiz.exception;
public class CompanyNotFoundException extends SubjectNotFoundException{
    private static String msg =new ExceptionCodeMsg("001", "企业未找到").getMsg() ;

    public CompanyNotFoundException(){
        super.msg = msg;
    }
}

异常编码类

package combiz.exception;
public class ExceptionCodeMsg {
   private String code;
   private String msg;
   public ExceptionCodeMsg(String code,String msg){
       this.code = code;
       this.msg = msg;
   }
   public String getMsg(){
       return "错误码:"+code+",错误信息:"+msg;
   }
 }