


Detailed explanation of the installation and use of eAccelerator_PHP tutorial
1. PHPeAccelerator installation
Go to https://github.com/eaccelerator/eaccelerator/downloads to download the latest version of the installation package, unzip the installation package, and enter the decompressed Folder directory,
Compile:
$PHP_PREFIX/bin/phpize
./configure--enable-shared --with-php-config=$PHP_PREFIX/bin/php-config
make
Installation:
makeinstall
Modify 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"
Create a new cache directory:
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
is used to determine which php file is cached. You can match php scripts that need to be cached by using wildcards (such as "*.php*.phtml"). If it starts with "!", it means there is no match. This parameter is empty by default and can cache all compiled php script needs Note that eaccelerator.filter does not work based on URL, but based on the absolute path of the file, such as defining "!/home", then all scripts in the /home directory will not be cached. If you want to define multiple matches, separate them with spaces or tabs, not commas.
eaccelerator.shm_ttl
When eAcelerator has no free shared memory, Scripts that have not been accessed for at least shm_ttl seconds will be released from the cache. The default value is 0, which means eA will not release any cache.
eaccelerator.shm_prune_period
When there is not enough memory for caching, eA Will try to clear the expired script again when the last time the cache was cleared exceeds the number of seconds set by shm_prune_period. The default value is 0, eA will not clear expired scripts from cache.
eaccelerator.shm_only
Enable or disable disk cache. This option has no effect on caching of session data and content. The default value is 0, allowing eA to use disk and memory for caching.
eaccelerator.allowed_admin_path
Enable or disable disk cache. This option has no effect on caching of session data and content. The default value is 0, allowing eA to use disk and memory for caching.
3. PHPeAccelerator monitoring and management
eAccelerator provides control.php for monitoring and managing eAccelerator cache. Place control.php in the website directory, modify the account number and password, and then you can monitor and manage the eAccelerator cache through the browser.
Lines 23 and 24 of control.php:
$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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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

Steps to update git code: Check out code: git clone https://github.com/username/repo.git Get the latest changes: git fetch merge changes: git merge origin/master push changes (optional): git push origin master

To download projects locally via Git, follow these steps: Install Git. Navigate to the project directory. cloning the remote repository using the following command: git clone https://github.com/username/repository-name.git

Git code merge process: Pull the latest changes to avoid conflicts. Switch to the branch you want to merge. Initiate a merge, specifying the branch to merge. Resolve merge conflicts (if any). Staging and commit merge, providing commit message.

Git Commit is a command that records file changes to a Git repository to save a snapshot of the current state of the project. How to use it is as follows: Add changes to the temporary storage area Write a concise and informative submission message to save and exit the submission message to complete the submission optionally: Add a signature for the submission Use git log to view the submission content

Resolve: When Git download speed is slow, you can take the following steps: Check the network connection and try to switch the connection method. Optimize Git configuration: Increase the POST buffer size (git config --global http.postBuffer 524288000), and reduce the low-speed limit (git config --global http.lowSpeedLimit 1000). Use a Git proxy (such as git-proxy or git-lfs-proxy). Try using a different Git client (such as Sourcetree or Github Desktop). Check for fire protection

How to update local Git code? Use git fetch to pull the latest changes from the remote repository. Merge remote changes to the local branch using git merge origin/<remote branch name>. Resolve conflicts arising from mergers. Use git commit -m "Merge branch <Remote branch name>" to submit merge changes and apply updates.

When developing an e-commerce website, I encountered a difficult problem: How to achieve efficient search functions in large amounts of product data? Traditional database searches are inefficient and have poor user experience. After some research, I discovered the search engine Typesense and solved this problem through its official PHP client typesense/typesense-php, which greatly improved the search performance.

To delete a Git repository, follow these steps: Confirm the repository you want to delete. Local deletion of repository: Use the rm -rf command to delete its folder. Remotely delete a warehouse: Navigate to the warehouse settings, find the "Delete Warehouse" option, and confirm the operation.
