一、删除旧版本 rpm -qa|grep php* or yum list installed |grep php yum remove php* 二、安装新版本 1.更新yum安装包 rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm 2.安装php和其它组件 yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64 yum install php70w-fpm sed -i -r "/^max_execution_time/ [email protected](max_execution_time = )[0-9][email protected]\[email protected]" /etc/php.ini sed -i -r "/^memory_limit/ [email protected](memory_limit = )[0-9]+(M)@\1128\[email protected]" /etc/php.ini sed -i -r "/^post_max_size/ [email protected](post_max_size = )[0-9]+(M)@\116\[email protected]" /etc/php.ini sed -i -r "/^upload_max_filesize/ [email protected](upload_max_filesize = )[0-9]+(M)@\12\[email protected]" /etc/php.ini sed -i -r "/^max_input_time/ [email protected](max_input_time = )[0-9][email protected]\[email protected]" /etc/php.ini sed -i -r "/^always_populate_raw_post_data/d; /^;always_populate_raw_post_data/ a\always_populate_raw_post_data = -1" /etc/php.ini sed -i -r "/^expose_php/ [email protected](expose_php = )[email protected]\[email protected]" /etc/php.ini vim /etc/php.ini date.timezone = Asia/Shanghai systemctl enable php-fpm systemctl start php-fpm
时间: 2024-10-27 14:02:46