During installation it is sugested that I add the php extension for opcode cacheing. PHP was installed with WAMP and I don't see that in the list of extensions to add. It is also listed as a PHP setting. Also I am not sure what to add. Ideas? Thank you.
I should note that I already added the suggested lines to php.ini.
(not strictly true but...) you should be running at least PHP 5.5 before we go any further. If you are not you can ignore the warning. Otherwise...
The documentation mentions changes to php.ini. For the WAMP server there is also a phpForApache.ini. Should I make the changes there as well?
The only way that I was able to get opcache to show up in phpinfo was by adding the line:
This line had to be added before the 'extension=' section. This was through trial and error and was not readily apparent from the documentation.
Thank you! Thank you! Have been struggling with an 'older' CentOS 5.x, PHP 5.3 box with 2 Gig memory that will never be upgraded (trying to keep it alive). Found it was possible to get zend opcache installed on it, but could never get it to load. Duh! Adding zend_ in front of the .so location line in the self-created opcache.ini in php.d did the trick. Am now able to compare APC with ZendOpCache.
Again ... many thanks!
'spirit of sharing', Ken
Ken, can you expand a bit further on exactly what you did?
I am using Ubuntu Server 12.04 LTS, which includes PHP 5.3.10. Trying to get Zend OPcache to work.
If I add the following lines to /etc/php5/apache2/php.ini, I can see Zend OPcache when I invoke phpinfo.php, but moodle 2.2.11 stops working altogether - "No data received" message in the browser. If I remove the lines from php.ini, moodle works again.
; Required for Moodle
opcache.use_cwd = 1
opcache.validate_timestamps = 1
opcache.save_comments = 1
opcache.enable_file_override = 0
; If something does not work in Moodle
opcache.revalidate_path = 1 ; May fix problems with include paths
Personally - I would upgrade your OS/PHP and get to PHP 5.5 (or newer). I had all sorts of problems on PHP 5.2 and 5.3. Upgrading PHP turned out to be the easier solution.
Well, I could, but it was with a CentOS 5.9 boxen ... whose upstream repo doesn't offer anything higher than 5.3.3.xxx just yet. While what I did might be similar, there's enough of a difference where it might not apply with a Ubuntu system.
I'll have to write up notes and post ... but like I said ... similar but not same.
'spirit of sharing', Ken
i have also the same question.
PHP opcode caching improves performance and lowers memory requirements, OPcache extension is recommended and fully supported.my PHP -v is PHP 5.4.16 i red in moodle NOTE: If you are running PHP 5.3 or 5.4 you can safely ignore the Environment Check message about OpCache''.
shall i ignore it or not?
You can ignore it. Nothing bad will happen.
You should, however, consider upgrading PHP to 5.5 (or 5.6) which comes with Opcache bundled in. I don't want to overstate the benefit but you typically see the load come down a bit on the server which is no bad thing.
Also, you should note that PHP 5.4 ceases to be supported in September (http://php.net/supported-versions.php)
PS. Better not to raise threads from the grave. It would have been better to create a new one.
Follow up ...
Got the directions for a CentOS 5.9 boxen (2 gig memory - not a virtual environment) from:
Also, the so I downloaded was really a dev for php 5.3.3 - highest version available from php.net (also require registration on their system to download). OpCache 7.0.3-dev.
I used the /etc/php.d/ route with a zendguardloader.ini (this came with ZGL) and had to place the .so in a directory for my system.
; Enable ZendGuard loader module
; Enables loading encoded scripts. The default value is On
; Disable license checks (for performance reasons)
; The Obfuscation level supported by Zend Guard Loader. The levels are detailed in the official Zend Guard Documentation.
; 0 - no obfuscation is enabled
; Path to where licensed Zend products should look for the product license. For more information on how to create a license file,
; see the Zend Guard User Guide
Again using /etc/php.d/ an opcache.ini
[root@moodle php.d]# cat opcache.ini
The key for me was this: zend_extension. Before I had extension= like other extensions and forgot that zend extensions needed to be id'd as zend extensions ... thus zend_extension=
php -m now shows:
Zend Guard Loader
And can use ocp.php and/or opcache.php now to view/reset.
Again ... don't know if Zend Guard Loader needed for Ubuntu ... but it was for CentOS 5.x. My situation was such that the entity will not spring for more memory chips (2 Gig memory not a virtual environment) nor opt to upgrade the OS to a higher version of anything.
Am in agreement with Howard ... if you can upgrade the OS or at least the PHP as the newer PHP it does come with zend opcache built in. Working to keep an old (somewhat out of date hardware wise) server is at best limited ... life/etc..
'spirit of sharing', Ken
thanks Ken and Howard -
just spotted the following at the moodle tracker. seems like i should i do as Howard suggests and bump Ubuntu to latest, or at least the PHP. i was trying to stick with LTS bundles as they tend to be more stable?
Well... they are "long term support" which (to possibly be pedantic) is not more stable. What it means is that patches will continue to be made for (iirc) 5 years. This is significant if you are running a bunch of server boxes with high availability and you don't want to touch the OS for the life of the boxes (hopefully). You are not really in that position, you are on the pointy-edge of running Moodle and so you need reasonably up to date OS components. It's a compromise. If you can live with some down-time it's reasonably easy to upgrade from one Ubuntu release to another every 6 months. OR... if you can wait a bit, there's another LTS release coming along with 14.04 in April.
ok, i follow all that Howard. i am fiddling on my own laptop which has ubuntu 13.10.
i noticed that 13.10, in addition to php 5.5, includes apache 2.4
have been using apache 2.2 all along. some changes there also.
looks like some of the apache 2.2. config needs to be tweaked for 2.4
some of my 2.2 sites are no longer accessible via apache 2.4
While Installing I had an error,
My php Version is 5.5, I copied the following code to xampp/php/php.ini in "Module Settings"
But still I get the same error, If i skip the error and continue installing, it installs successfully and creates admin user and moves to Edit Profile Settings Page
From that page I cant able to go to any page if I select the link
As mentioned above, you might also need to tweak "zend". Below is the line that I added to my php.ini. Maybe this will help.
; Need to specify this
It is not an error, just a suggestion/recommendation.