Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Ariel Lockshaw
Ariel Lockshaw
2,072 Points

OPcache warning on verify requirements during Drupal install?

I am getting a warning message at the Verify Requirements stage of the Drupal install saying that OPcache is highly recommended. I am not seeing a straightforward way on how to install this. Any suggestions?

Benjamin Larson
Benjamin Larson
34,055 Points

This will depend on what version of PHP you are running. If you are running PHP 5.5 or newer, it should already be installed you may just have to enable it in the php.ini file.

If you aren't sure what version of PHP you are running, you can run a script in a PHP file in your web server with this command;

<?php
phpinfo();
>?

or via command-line

php -v

If it is older than 5.5, you will have to install a PECL extension, but it may well be easier to upgrade your version of PHP or (XAMMP/MAMP/WAMP), provided you aren't running in a production environment with other sites that have a dependency on an earlier version of PHP. If you have more questions, others can input once we know more about your local environment.

As a side note, I'm also assuming that since you are getting that message that you are trying to install Drupal 8. Just a heads up that if you are planning to go through the Drupal course here on Treehouse, you may want to install Drupal 7. There are some significant changes between the 2 versions, though if (understandably), want to learn the latest version, just know that it may not correlate well with the course on Treehouse.

1 Answer

Benjamin Larson
Benjamin Larson
34,055 Points

I just ran the installation for Drupal 8 and saw that it display the version of PHP. If you followed the instructions from the course and have a recent version of WAMP or MAMP, you'll just need to open the php.ini file and add the following lines:

[opcache]
zend_extension=php_opcache.dll
;Determines if Zend OPCache in enabled
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1

The opchache settings may already be in there, but you'll have to un-comment them (remove the semi-colon ; on each line) and change some of the values. Just do a search/find in the file for opcache.

Also note, that once Drupal is installed, it's much less intimidating than this! The installation will probably be the worst of it.

Ariel Lockshaw
Ariel Lockshaw
2,072 Points

Thank you so much, Benjamin. I am using MAMP and the newest version of Drupal. I do see the differences but have managed to figure them out relatively easily. I will try your course of action! Thanks again for this awesome and helpful response!