{"id":11216,"date":"2022-08-25T10:01:15","date_gmt":"2022-08-25T02:01:15","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=11216"},"modified":"2022-08-25T13:26:37","modified_gmt":"2022-08-25T05:26:37","slug":"centos-yum-php","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/centos-yum-php.html","title":{"rendered":"Centos\u5b89\u88c5php\u9ad8\u7248\u672c"},"content":{"rendered":"
Centos\u7cfb\u7edf\u81ea\u5e26\u7684php\u7248\u672c\u5f88\u4f4e\uff0c\u5982\u679c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u9ad8\u7248\u672c\u7684php\uff0c\u53ef\u4ee5\u4e0d\u7528\u7f16\u8bd1\u5b89\u88c5\uff0c\u76f4\u63a5\u7528yum\u5b89\u88c5\u4f1a\u975e\u5e38\u7701\u65f6\u7701\u529b\u3002
\n<\/p>\n
PHP\uff08\u8d85\u6587\u672c\u9884\u5904\u7406\u5668\uff09\u662f\u4e00\u79cd\u901a\u7528\u5f00\u6e90\u811a\u672c\u8bed\u8a00\u3002\u8bed\u6cd5\u5438\u6536\u4e86C\u8bed\u8a00\u3001Java\u548cPerl\u7684\u7279\u70b9\uff0c\u5229\u4e8e\u5b66\u4e60\uff0c\u4f7f\u7528\u5e7f\u6cdb\uff0c\u4e3b\u8981\u9002\u7528\u4e8eWeb\u5f00\u53d1\u9886\u57df\u3002PHP \u72ec\u7279\u7684\u8bed\u6cd5\u6df7\u5408\u4e86C\u3001Java\u3001Perl\u4ee5\u53caPHP\u81ea\u521b\u7684\u8bed\u6cd5\u3002<\/p>\n
\u7528PHP\u505a\u51fa\u7684\u52a8\u6001\u9875\u9762\u4e0e\u5176\u4ed6\u7684\u7f16\u7a0b\u8bed\u8a00\u76f8\u6bd4\uff0cPHP\u662f\u5c06\u7a0b\u5e8f\u5d4c\u5165\u5230HTML\uff08\u6807\u51c6\u901a\u7528\u6807\u8bb0\u8bed\u8a00\u4e0b\u7684\u4e00\u4e2a\u5e94\u7528\uff09\u6587\u6863\u4e2d\u53bb\u6267\u884c\uff0c\u6267\u884c\u6548\u7387\u6bd4\u5b8c\u5168\u751f\u6210HTML\u6807\u8bb0\u7684CGI\u8981\u9ad8\u8bb8\u591a\uff1bPHP\u8fd8\u53ef\u4ee5\u6267\u884c\u7f16\u8bd1\u540e\u4ee3\u7801\uff0c\u7f16\u8bd1\u53ef\u4ee5\u8fbe\u5230\u52a0\u5bc6\u548c\u4f18\u5316\u4ee3\u7801\u8fd0\u884c\uff0c\u4f7f\u4ee3\u7801\u8fd0\u884c\u66f4\u5feb\u3002<\/p>\n
rpm -qa|grep php\r\n<\/pre>\n\u5982\u679c\u6709\u5b89\u88c5PHP\uff0c\u90a3\u4e48\u8bf7\u5148\u5220\u9664\u8fd9\u4e9b\u5b89\u88c5\u5305\uff1a<\/p>\n
yum remove php*\r\n<\/pre>\n2.\u5b89\u88c5php\u6e90<\/strong><\/span><\/div>\nCentos 5 \u5b89\u88c5php\u6e90\uff1a<\/p>\n
rpm -ivh http:\/\/mirror.webtatic.com\/yum\/el5\/latest.rpm\r\n<\/pre>\nCentOs 6 \u5b89\u88c5php\u6e90\uff1a<\/p>\n
rpm -ivh http:\/\/mirror.webtatic.com\/yum\/el6\/latest.rpm\r\n<\/pre>\nCentOs 7 \u5b89\u88c5php\u6e90\u548cepel\u6269\u5c55\u6e90\uff1a<\/p>\n
rpm -ivh https:\/\/mirror.webtatic.com\/yum\/el7\/epel-release.rpm\r\nrpm -ivh https:\/\/mirror.webtatic.com\/yum\/el7\/webtatic-release.rpm\r\n<\/pre>\n3.\u73b0\u5728\u5f00\u59cb\u5b89\u88c5php<\/strong><\/span><\/div>\n\u5b89\u88c5php5.5\u7684\u57fa\u672c\u5b89\u88c5\u5305\uff1a<\/p>\n
yum install php55w php55w-gd php55w-mbstring php55w-mysql php55w-fpm \r\n<\/pre>\n\u5b89\u88c5php5.6\u7684\u57fa\u672c\u5b89\u88c5\u5305\uff1a<\/p>\n
yum install php56w php56w-gd php56w-mbstring php56w-mysql php56w-fpm \r\n<\/pre>\n\u5b89\u88c5php7.0\u7684\u57fa\u672c\u5b89\u88c5\u5305\uff1a<\/p>\n
yum install php70w php70w-gd php70w-mbstring php70w-mysql php70w-fpm\r\n<\/pre>\n\u5b89\u88c5\u5b8c\u6210php\u4e4b\u540e\u9700\u8981\u91cd\u542fapache\uff1a<\/p>\n
service httpd restart\r\n<\/pre>\n4. \u6d4b\u8bd5\u7f51\u9875<\/strong><\/span><\/div>\n\u6211\u5b89\u88c5\u7684php7.0\uff0c\u5c31\u62ffphp7.0\u5199\u4e2a\u7f51\u9875\u6d4b\u8bd5\u4e00\u4e0b<\/p>\n
vim \/var\/www\/html\/index.php\r\n\r\n<?php \r\nphpinfo(); \r\n?>\r\n<\/pre>\n<\/p>\n
\n