eAccelerator的安装与使用详解
本篇文章是对eAccelerator的安装与使用进行了详细的分析介绍,需要的朋友参考下
一、PHPeAccelerator安装
去https://github.com/eaccelerator/eaccelerator/downloads下载最新版安装包,解压安装包,进入解压后的文件夹目录,
编译:
复制代码 代码如下:
$PHP_PREFIX/bin/phpize
./configure--enable-shared --with-php-config=$PHP_PREFIX/bin/php-config
make
安装:
复制代码 代码如下:
makeinstall
修改php.ini:
复制代码 代码如下:
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
新建缓存目录:
复制代码 代码如下:
mkdir/tmp/eaccelerator
chmod0777 /tmp/eaccelerator
二、PHPeAccelerator配置选项
eaccelerator.shm_size
用来设置分配给eAccelerator用来缓存php的最大共享内存,单位是mb,如果设置为0,服务器空间,就使用默认大小。在linux系统中一个process能分配的最大内存是由/proc/sys/kernel/shmmax限制的,所以如果eA设置的内存超出了这个值,eA在初始化的时候会失败。shmmax的单位是字节(bytes)
eaccelerator.cache_dir
用来设置硬盘缓存目录。eA用来存放预编译代码,session数据,网站空间,内容和用户入口。默认值是"/tmp/eaccelerator"。
eaccelerator.enable
用来设置是否启用或禁用eAccelerator,设置1为启用,设置0为禁用。
eaccelerator.optimizer
开启或关闭优化,用户加速代码的执行。1为开启,0为关闭,优化仅仅在脚本被编译时候发生并且是在被缓存之前。
eaccelerator.debug
开启关闭debug日志。如果设置为1,将打印很多文件命中的信息到日志中。这个在排查eAccelerator的时候很有用。
eaccelerator.check_mtime
在每次命中的时候Eaccelerator都会检查脚本的修改时间来判断是不是脚本发生的变化来决定是否需要重新编译。尽管检查比打开文件并编译要快,但仍然会带来一些开销的,因为每次都会有状态调用要完成。这个配置可以关闭这个检查。不过关闭检查带来的不利就是每次更新了文件需要认为手动的清除cache。默认检查是启用的,1是启用,0是禁用。
eaccelerator.filter
用来决定哪个php文件被缓存。可以通过使用通配符(比如"*.php*.phtml")来匹配需要缓存的php脚本。如果以"!"开头,表示不匹配,这个参数默认是空,可以缓存所有编译好的php脚本需要注意的是eaccelerator.filter并不是基于URL工作的,而是基于文件的绝对路径,比如定义了"!/home"的话,那所有/home目录的脚本都不会被缓存。如果要定义多个匹配,使用空格或者制表符分开,而不是逗号。
eaccelerator.shm_ttl
当eAcelerator没有空余的共享内存的时候,就会把最少shm_ttl设置的秒数没访问过的脚本从缓存中释放掉,默认值是0,表示eA不会释放任何缓存。
eaccelerator.shm_prune_period
当没有足够的内存用来缓存的时候,eA会在上次清除缓存的时间超过了shm_prune_period设定的秒数时再次尝试清除过期的脚本。默认值为0,eA将不从缓存中清除过期的脚本。
eaccelerator.shm_only
启用或者禁用磁盘缓存。这个选项对session数据和内容的缓存没效果。默认值是0,允许eA使用磁盘和内存进行缓存。
eaccelerator.allowed_admin_path
启用或者禁用磁盘缓存。这个选项对session数据和内容的缓存没效果。默认值是0,允许eA使用磁盘和内存进行缓存。
三、PHPeAccelerator监控与管理
eAccelerator提供了control.php,香港服务器,用于监控与管理eAccelerator缓存。将control.php放到网站目录中,修改账号、密码,即可通过浏览器监控与管理eAccelerator缓存。
control.php第23、24行:
复制代码 代码如下:
$user= "admin";
$pw= "password";

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

CrystalDiskMark is a small HDD benchmark tool for hard drives that quickly measures sequential and random read/write speeds. Next, let the editor introduce CrystalDiskMark to you and how to use crystaldiskmark~ 1. Introduction to CrystalDiskMark CrystalDiskMark is a widely used disk performance testing tool used to evaluate the read and write speed and performance of mechanical hard drives and solid-state drives (SSD). Random I/O performance. It is a free Windows application and provides a user-friendly interface and various test modes to evaluate different aspects of hard drive performance and is widely used in hardware reviews

If you have successfully downloaded the installation file of Baidu Netdisk, but cannot install it normally, it may be that there is an error in the integrity of the software file or there is a problem with the residual files and registry entries. Let this site take care of it for users. Let’s introduce the analysis of the problem that Baidu Netdisk is successfully downloaded but cannot be installed. Analysis of the problem that Baidu Netdisk downloaded successfully but could not be installed 1. Check the integrity of the installation file: Make sure that the downloaded installation file is complete and not damaged. You can download it again, or try to download the installation file from another trusted source. 2. Turn off anti-virus software and firewall: Some anti-virus software or firewall programs may prevent the installation program from running properly. Try disabling or exiting the anti-virus software and firewall, then re-run the installation

foobar2000 is a software that can listen to music resources at any time. It brings you all kinds of music with lossless sound quality. The enhanced version of the music player allows you to get a more comprehensive and comfortable music experience. Its design concept is to play the advanced audio on the computer The device is transplanted to mobile phones to provide a more convenient and efficient music playback experience. The interface design is simple, clear and easy to use. It adopts a minimalist design style without too many decorations and cumbersome operations to get started quickly. It also supports a variety of skins and Theme, personalize settings according to your own preferences, and create an exclusive music player that supports the playback of multiple audio formats. It also supports the audio gain function to adjust the volume according to your own hearing conditions to avoid hearing damage caused by excessive volume. Next, let me help you

Installing Android applications on Linux has always been a concern for many users. Especially for Linux users who like to use Android applications, it is very important to master how to install Android applications on Linux systems. Although running Android applications directly on Linux is not as simple as on the Android platform, by using emulators or third-party tools, we can still happily enjoy Android applications on Linux. The following will introduce how to install Android applications on Linux systems.

Cloud storage has become an indispensable part of our daily life and work nowadays. As one of the leading cloud storage services in China, Baidu Netdisk has won the favor of a large number of users with its powerful storage functions, efficient transmission speed and convenient operation experience. And whether you want to back up important files, share information, watch videos online, or listen to music, Baidu Cloud Disk can meet your needs. However, many users may not understand the specific use method of Baidu Netdisk app, so this tutorial will introduce in detail how to use Baidu Netdisk app. Users who are still confused can follow this article to learn more. ! How to use Baidu Cloud Network Disk: 1. Installation First, when downloading and installing Baidu Cloud software, please select the custom installation option.

NetEase Mailbox, as an email address widely used by Chinese netizens, has always won the trust of users with its stable and efficient services. NetEase Mailbox Master is an email software specially created for mobile phone users. It greatly simplifies the process of sending and receiving emails and makes our email processing more convenient. So how to use NetEase Mailbox Master, and what specific functions it has. Below, the editor of this site will give you a detailed introduction, hoping to help you! First, you can search and download the NetEase Mailbox Master app in the mobile app store. Search for "NetEase Mailbox Master" in App Store or Baidu Mobile Assistant, and then follow the prompts to install it. After the download and installation is completed, we open the NetEase email account and log in. The login interface is as shown below

MetaMask (also called Little Fox Wallet in Chinese) is a free and well-received encryption wallet software. Currently, BTCC supports binding to the MetaMask wallet. After binding, you can use the MetaMask wallet to quickly log in, store value, buy coins, etc., and you can also get 20 USDT trial bonus for the first time binding. In the BTCCMetaMask wallet tutorial, we will introduce in detail how to register and use MetaMask, and how to bind and use the Little Fox wallet in BTCC. What is MetaMask wallet? With over 30 million users, MetaMask Little Fox Wallet is one of the most popular cryptocurrency wallets today. It is free to use and can be installed on the network as an extension

If you have used Docker, you must understand daemons, containers, and their functions. A daemon is a service that runs in the background when a container is already in use in any system. Podman is a free management tool for managing and creating containers without relying on any daemon such as Docker. Therefore, it has advantages in managing containers without the need for long-term backend services. Additionally, Podman does not require root-level permissions to be used. This guide discusses in detail how to install Podman on Ubuntu24. To update the system, we first need to update the system and open the Terminal shell of Ubuntu24. During both installation and upgrade processes, we need to use the command line. a simple
