Modern PHP enable Zend Opcache

Source: Internet
Author: User
Tags php script php web server

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.