-
-
Save danielnunez/8682d4bafd7f7c19d77d8c3c34b74f6f to your computer and use it in GitHub Desktop.
Revisions
-
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,7 @@ opcache.revalidate_freq=60 opcache.fast_shutdown=1 ``` The following can also be set, but in applications that use code comments as executable code (i.e. symfony's annotation) this will cause problems as it will strip comment out of the pre-compiled byte code: ``` opcache.save_comments=0 opcache.load_comments=0 -
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -54,4 +54,5 @@ sudo apachectl graceful ###References - PHP's recommended OpCache settings: http://php.net/manual/en/opcache.installation.php - OpCache information - http://www.sitepoint.com/understanding-opcache/ - OpCache config suggestions: https://www.scalingphpbook.com/blog/2014/02/14/best-zend-opcache-settings.html - OpCache troubleshooting: https://tideways.io/profiler/blog/fine-tune-your-opcache-configuration-to-avoid-caching-suprises -
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,11 @@ opcache.revalidate_freq=60 opcache.fast_shutdown=1 ``` ``` opcache.save_comments=0 opcache.load_comments=0 ``` `opcache.max_accelerated_files` should be higher than the amount of PHP files that are going to be cached. Fine tune this by counting the number of `.php` files in your project directory with (note the path used here is the default Apache DocumentRoot path, change as needed): ``` find /usr/local/www/apache24/data -iname *.php|wc -l @@ -41,6 +46,11 @@ Check the status of OpCache with: php -r 'var_dump(opcache_get_status(false));' ``` Restart Apache: ``` sudo apachectl graceful ``` ###References - PHP's recommended OpCache settings: http://php.net/manual/en/opcache.installation.php - OpCache information - http://www.sitepoint.com/understanding-opcache/ -
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,4 +43,5 @@ php -r 'var_dump(opcache_get_status(false));' ###References - PHP's recommended OpCache settings: http://php.net/manual/en/opcache.installation.php - OpCache information - http://www.sitepoint.com/understanding-opcache/ - OpCache config suggestions: https://www.scalingphpbook.com/blog/2014/02/14/best-zend-opcache-settings.html -
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,6 +21,7 @@ opcache.enable_cli=1 opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.use_cwd=1 opcache.revalidate_freq=60 opcache.fast_shutdown=1 ``` -
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,4 +41,5 @@ php -r 'var_dump(opcache_get_status(false));' ``` ###References - PHP's recommended OpCache settings: http://php.net/manual/en/opcache.installation.php - OpCache config suggestions: https://www.scalingphpbook.com/blog/2014/02/14/best-zend-opcache-settings.html -
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,6 +25,11 @@ opcache.revalidate_freq=60 opcache.fast_shutdown=1 ``` `opcache.max_accelerated_files` should be higher than the amount of PHP files that are going to be cached. Fine tune this by counting the number of `.php` files in your project directory with (note the path used here is the default Apache DocumentRoot path, change as needed): ``` find /usr/local/www/apache24/data -iname *.php|wc -l ``` Check the OpCache running configuration in the command line with: ``` php -r 'var_dump(opcache_get_configuration());' -
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,10 +25,15 @@ opcache.revalidate_freq=60 opcache.fast_shutdown=1 ``` Check the OpCache running configuration in the command line with: ``` php -r 'var_dump(opcache_get_configuration());' ``` Check the status of OpCache with: ``` php -r 'var_dump(opcache_get_status(false));' ``` ###References - PHP's recommended OpCache settings: http://php.net/manual/en/opcache.installation.php -
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 21 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,34 @@ OpCache ======= Installation ------------ Install OpCache on FreeBSD with (note `56` resembles the current PHP version 5.6): ``` cd /usr/ports/www/php56-opcache && sudo make config-recursive install distclean ``` Configuration ------------- Open up `php.ini` to configure OpCache settings: ``` sudo ee /usr/local/etc/php.ini ``` Find and uncomment the following directives (by removing the `;` at the front of the directive's line), then set their values to the required value: ``` opcache.enable=1 opcache.enable_cli=1 opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.revalidate_freq=60 opcache.fast_shutdown=1 ``` Check the OpCache running configuration in the command line with (note `php -r 'var_dump(opcache_get_status());'` can be used to check if OpCache is running, but results in CLI are unreliable): ``` php -r 'var_dump(opcache_get_configuration());' ``` ###References - PHP's recommended OpCache settings: http://php.net/manual/en/opcache.installation.php -
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,11 @@ Install OpCache on FreeBSD with (note `56` resembles the current PHP version 5.6 cd /usr/ports/www/php56-opcache && sudo make config-recursive install distclean ``` Open up `php.ini` to configure OpCache settings: ``` sudo ee /usr/local/etc/php.ini ``` Check the OpCache running configuration in the command line with (note `php -r 'var_dump(opcache_get_status());'` can be used to check if OpCache is running, but results in CLI are unreliable): ``` php -r 'var_dump(opcache_get_configuration());' -
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ Install OpCache on FreeBSD with (note `56` resembles the current PHP version 5.6): ``` cd /usr/ports/www/php56-opcache && sudo make config-recursive install distclean ``` Check the OpCache running configuration in the command line with (note `php -r 'var_dump(opcache_get_status());'` can be used to check if OpCache is running, but results in CLI are unreliable): ``` -
WillSquire revised this gist
Apr 11, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ Check the OpCache running configuration in the command line with (note `php -r 'var_dump(opcache_get_status());'` can be used to check if OpCache is running, but results in CLI are unreliable): ``` php -r 'var_dump(opcache_get_configuration());' ``` -
WillSquire created this gist
Apr 11, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ // Check if OpCache is running in the command line with: ``` php -r 'var_dump(opcache_get_status());' ```