【Web 集群实战】14_PHP 服务缓存加速(Opcache+Memcached+pdo_mysql+imagick)

本文介绍了如何在PHP服务中实现加速,包括配置LNMP基础环境,解决Perl编译问题,安装和配置PHP的Opcache缓存模块,安装Memcached插件以提升性能,安装PDO_MySQL以优化数据库操作,以及安装Imagick扩展进行图像处理。通过这些步骤,可以显著提高PHP应用的运行效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

【Web 集群实战】14_PHP 服务缓存加速(Opcache+Memcached+pdo_mysql+imagick)

标签(空格分隔): Web集群实战


一、LNMP 基础 Web 环境准备

软件 版本
Linux CentOS 7.4.1708 64bit
Nginx 1.14.0
PHP 7.1.22
MySQL 5.5.61
[root@ylt001 ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[root@ylt001 ~]# uname -r
3.10.0-693.el7.x86_64
[root@ylt001 ~]# uname -m
x86_64

[root@ylt001 ~]# /application/nginx/sbin/nginx -v
nginx version: nginx/1.14.0

[root@ylt001 ~]# /application/php/bin/php -v
PHP 7.1.22 (cli) (built: Sep 25 2018 06:46:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.22, Copyright (c) 1999-2018, by Zend Technologies

[root@ylt001 ~]# mysqladmin -uroot -p version
Enter password:
mysqladmin  Ver 8.42 Distrib 5.5.61, for linux-glibc2.12 on x86_64
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Server version          5.5.61
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /tmp/mysql.sock
Uptime:                 5 min 28 sec

Threads: 1  Questions: 4  Slow queries: 0  Opens: 33  Flush tables: 1  Open tables: 26  Queries per second avg: 0.012
  • 开启所有服务
[root@ylt001 ~]# /application/nginx/sbin/nginx
[root@ylt001 ~]# /application/nginx/sbin/nginx -t
[root@ylt001 ~]# /application/nginx/sbin/nginx -s reload

[root@ylt001 ~]# killall php-fpm
[root@ylt001 ~]# /application/php/sbin/php-fpm
[root@ylt001 ~]# ps -ef|grep php-fpm

[root
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值