Bytecode caching can store pre-compiled PHP code
* If you are compiling PHP yourself
./configure--enable-opcache
After compiling the php.ini.
Zend_extension=opcache.so
View the directory where the PHP extension resides
Php-config--extension-dir
/applications/xampp/xamppfiles/lib/php/extensions/no-debug-non-zts-20170718
Warning: If you use Xdebug, the php.ini file must load the Zend Opcache extension before loading Xdebug
* Local test configuration Zend Opcache
mkdir./configcp/applications/xampp//xamppfiles/etc/php.ini./config/php.ini
Add configuration
Zend_extension=opcache.soopcache.validate_timestamps=1;; Set as 0opcache.revalidate_freq=0opcache.memory_consumption=64opcache.interned_strings_buffer=16opcache.max_ in the production environment Accelerated_files=4000opcache.fast_shutdown=1
If the value of the opcache.validate_timestamps instruction in the php.ini file is 0, Zend Opcache is unaware of the changes in the PHP script, we must manually empty the Zend Opcache the cached bytecode and let it discover php file changes.
Php-s localhost:4000-c Config/php.ini
If you need to access this PHP Web server from another device on the same LAN, slow the localhost to 0.0.0.0
Php-s 0.0.0.0:4000-c./config/php.ini
* Find out if you are using a built-in server
Echo Php_sapi_name (). Php_eol; ' Cli-server '
If it is on the command line PHP xxx.php//' CLI '
Modern PHP enable Zend Opcache