侯体宗的博客
  • 首页
  • Hyperf版
  • beego仿版
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

opcache.so让你的php服务器性能提升10倍,丝毫不夸张

框架(架构)  /  管理员 发布于 2年前   1098

环境:我用的是lnmp一键安装包,是1.6版本的 PHP是7.3已经预装了,直接开启


看看opcache的介绍

此脚本是用来安装opcache的,是 Zend 开发的闭源但可以免费使用的 PHP 优化加速组件。LNMP 1.2下安装的PHP 5.5或更高版本的PHP不需要额外安装OPcache,默认已经安装上。
1.3上默认已安装但未启用执行:./addons.sh install opcache 进行开启。

安装
进入lnmp解压后的目录,执行:./addons.sh install opcache 
Opcache和eAccelerator是冲突的,脚本会卸载eAccelerator后再安装Opcache,回车确认后就会自动安装opcache。

 lnmp1.6]# ./addons.sh install opcache 
+-----------------------------------------------------------------------+
|            Addons script for LNMP V1.6, Written by Licess             |
+-----------------------------------------------------------------------+
|    A tool to Install cache,optimizer,accelerator...addons for LNMP    |
+-----------------------------------------------------------------------+
|           For more information please visit https://lnmp.org          |
+-----------------------------------------------------------------------+
Install Opcache will auto uninstall eAccelerator if exists...
====== Installing zend opcache ======
Press any key to start...or Press Ctrl+c to cancel
Uninstall eAccelerator...
Copy Opcache Control Panel...
Restarting php-fpm......
Gracefully shutting down php-fpm . done
Starting php-fpm  done
====== Opcache install completed ======
Opcache installed successfully, enjoy it!

装完了

配置文件在 /usr/local/php/conf.d/ 这个目录下面,你也可以用phpinfo查看

卸载
执行:./addons.sh uninstall opcache


看看效果

load average: 2.56, 3.82, 24.00

数据夸张不 我的服务器配置比较高没有优化



  • 上一条:
    Lua字符串库(string库)学习笔记
    下一条:
    nginx限流方式之漏桶算法与令牌桶算法的详解
  • 昵称:

    邮箱:

    0条评论 (评论内容有缓存机制,请悉知!)
    最新最热
    • 分类目录
    • 人生(杂谈)
    • 技术
    • linux
    • Java
    • php
    • 框架(架构)
    • 前端
    • ThinkPHP
    • 数据库
    • 微信(小程序)
    • Laravel
    • Redis
    • Docker
    • Go
    • swoole
    • Windows
    • Python
    • 苹果(mac/ios)
    • 相关文章
    • windows系统phpstudy环境中安装amqp拓展流程步骤(0个评论)
    • 安装docker + locust + boomer压测环境实现对接口的压测(1个评论)
    • 通过CodePipeline在AWS Elastic Beanstalk上部署PHP(Laravel)应用程序(0个评论)
    • Saga分布式事务(0个评论)
    • ubuntu中搭建lnmp环境部署laravel9框架项目流程步骤(0个评论)
    • 近期文章
    • GnuPG(GPG)生成用于替代SSH密钥的子密钥:签名、加密、鉴权及SSH验证(0个评论)
    • GnuPG(GPG)密钥创建的流程步骤(0个评论)
    • Laravel 9.24版本发布(0个评论)
    • windows系统phpstudy环境中安装amqp拓展流程步骤(0个评论)
    • windows10+docker desktop使用docker compose编排多容器构建dnmp环境(0个评论)
    • windows10+docker desktop运行laravel项目报错:could not find driver...(0个评论)
    • windows10+docker desktop报错:docker: Error response from daemon: user declined directory sharing(0个评论)
    • go语言中Pat多路复用器路由功能示例代码(0个评论)
    • go语言中HttpRouter多路复用器路由功能示例代码(0个评论)
    • js中使用Push.js通知库将通知推送到浏览器(0个评论)
    • 近期评论
    • nkt 在

      阿里云香港服务器搭建自用vpn:Shadowsocks使用流程步骤中评论 用了三分钟就被禁了,直接阿里云服务器22端口都禁了..
    • 熊丽 在

      安装docker + locust + boomer压测环境实现对接口的压测中评论 试试水..
    • 博主 在

      阿里云香港服务器搭建自用vpn:Shadowsocks使用流程步骤中评论 @test  也可能是国内大环境所至,也是好事,督促你该研究学习新技术..
    • test 在

      阿里云香港服务器搭建自用vpn:Shadowsocks使用流程步骤中评论 打了一次网页,然后再也打不开了。。是阿里云的缘故吗?..
    • 博主 在

      centos7中Meili Search搜索引擎安装流程步骤中评论 @鹿   执行以下命令看看你的2.27版本是否存在strin..
    • 2018-05
    • 2020-02
    • 2020-03
    • 2020-05
    • 2020-06
    • 2020-08
    • 2020-11
    • 2021-03
    • 2021-09
    • 2021-10
    • 2021-11
    • 2022-01
    • 2022-02
    • 2022-03
    • 2022-08
    Top

    Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号 PHP交流群

    侯体宗的博客