Task #51475
Use PHP 5.5 zend opcache with typo3 > TYPO3_6.1
Status: | Closed | Start date: | 2013-08-28 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | - | |||
Target version: | - |
Description
To use the new zend Opcode Cache in php version 5.5 there some small fixes in the php.ini to resolve some php errors. Also the Extensions Manager don't let you Install or unistall extensions.
First aktivate opcache in php.ini.
opcache.enable=1
;tell php.ini where can find the opcache.so At the verry end of php.ini
zend_extension=/path/to/opcache.so.
;now create a Directory on your server and name it "opcache" and create a .txt file and named "opcacheBlacklist.txt" to exclude ;some Files/Directorys from opcache. Copy the following file paths in this opcacheBlacklist.txt file.
; Matches a specific file.
/var/www/virtual/on/html/typo3conf/LocalConfiguration.php
/var/www/virtual/on/TYPO3.CMS/typo3/sysext/core/Classes/Cache/Backend/FileBackend.php
; A prefix that matches all files starting
/var/www/virtual/on/html/typo3temp/Cache/Code/
/var/www/virtual/on/html/typo3temp/Cache/Data/
; and uncomment the following lines in your php.ini
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.max_wasted_percentage=5
opcache.use_cwd=1
opcache.validate_timestamps=1
opcache.revalidate_freq=0
opcache.revalidate_path=0opcache.save_comments=1
opcache.load_comments=1
opcache.fast_shutdown=1
opcache.enable_file_override=1
opcache.optimization_level=0xffffffff
opcache.inherited_hack=1
opcache.dups_fix=0
; change the path to your "opcache/opcacheBlacklist.txt" file
opcache.blacklist_filename=/path/to/your/opcache/opcacheBlacklist.txt
opcache.max_file_size=0
opcache.consistency_checks=0
opcache.force_restart_timeout=180
opcache.error_log=stderr
opcache.log_verbosity_level=1
opcache.preferred_memory_model=
opcache.protect_memory=0
This works fine for me on my server. If you have some better adjustments please let me know
greetings
Matthias
Related issues
History
#1 Updated by Philipp Gampe almost 2 years ago
- Status changed from New to Accepted
#2 Updated by Philipp Gampe almost 2 years ago
- Assigned To deleted (
Philipp Gampe)
#3 Updated by Chris topher almost 2 years ago
- Status changed from Accepted to Needs Feedback
Hi Matthias,
thanks for the information!
This kind of stuff would belong in the section Trouble Shooting > PHP. However, we will have to check, in how far things are actually special for TYPO3 or only general PHP configuration, which does not have room in this manual.
I have some questions concerning the settings:
- You are excluding the configuration files and some cache files. And FileBackend.php must be excluded? Why? If that is really necessary, I guess it's some kind of bug...
- Which of the settings, which you provided, are not default or recommended settings? Meaning: Which of these did you have to change?
#4 Updated by Charles Brunet almost 2 years ago
#46957 seems related to this.
#5 Updated by Charles Coleman over 1 year ago
It seems I'm experiencing the same issues, but setting revalidate_freq=0 didn't seem to solve my problem. Nevertheless, I'll share the different settings when you have Zend Server CE installed.
Here's what I did in CentOS 6.5 with Zend Server CE so far...¶
There are two main php.ini files that's I'm aware of:
- /etc/php.ini
- /usr/local/zend/etc/php.ini (this is the one I edited)
I place this content at the end of the php.ini file (I found it online so didn't think out each parameter):
[Zend] zend_extension = /usr/local/zend/lib/optimizerplus/php-5.3.x/ZendOptimizerPlus.so zend_optimizerplus.enable=1 zend_optimizerplus.use_cwd=1 zend_optimizerplus.validate_timestamp=0 ; file stat zend_optimizerplus.revalidate_freq=0 ; seconds zend_optimizerplus.revalidate_path=0 zend_optimizerplus.dups_fix=0 zend_optimizerplus.log_verbosity_level=1 zend_optimizerplus.memory_consumption=128 zend_optimizerplus.interned_strings_buffer=16 ; default 4 - undocumented? zend_optimizerplus.max_accelerated_files=2000 zend_optimizerplus.max_wasted_percentage=25 ; percent waste until restart zend_optimizerplus.consistency_checks=0 zend_optimizerplus.force_restart_timeout=60 zend_optimizerplus.blacklist_filename= zend_optimizerplus.fast_shutdown=0 zend_optimizerplus.optimization_level=0xfffffbbf zend_optimizerplus.enable_slow_optimizations=1
I'm not sure how the order of precedence works, but I wasn't able to get the revalidate_freq to equal 0 when doing a phpinfo until I also edited the line, zend_optimizerplus.revalidate_freq=0, in /usr/local/zend/etc/conf.d/optimizerplus.ini, which is included by /usr/local/zend/etc/php.ini.
If anyone can corrent my notation or tell me why I still cannot install extension I'd be MORE than grateful.
#6 Updated by Chris topher over 1 year ago
- Status changed from Needs Feedback to Closed
I have not encountered this problem myself and I cannot say, how to solve it.
If you need help in getting around the problem, you should use the forum or the mailing lists.
Once you know the exact settings needed to work around the error, please open a new issue here so that I can implement the solution.
Thanks!
#7 Updated by Nicolas Forgeot over 1 year ago
Thank you Matthias Eberlein for your configuration, it solves the problem of installing extension.
opcache.enable_file_override=1 create an error "zend_mm_heap corrupted", 502 Bad Gateway on FE.