George McKinney Adventures in Software Development

November 30, 2020

Disabling Zend OPcache

Filed under: Laminas,PHP,Zend Framework — georgemck @ 8:14 am

I ran across the need to disable Zend OPcache when working with Laminas API Tools in PHP, which was formerly called Zend Framework’s APIgility. In addition to requiring PHP Unit, you have to disable Zend OPcache to create a working API. Zend OPcache is bundled with many PHP installations to improve performance. In development on our local computers, we need to turn this off if we want this tool to work!

On your running server, figure out if it is on. You can see this in phpinfo() command. Create file name phpinfo.php and make sure it has correct permissions to run
<?php
phpinfo();
?>
Start your Development Server with built-in PHP server on Port 8080. Then retrieving the php settings information, phpinfo.php. Do not put this information on production server!
php server started view phpinfo
Here, the phpinfo() command shows the loaded configuration file location. /etc/php/7.4/cli/php.ini
phpinfo loaded showing php.ini file
Zend OPcache is enabled.
phpinfo shows zend opcache is ON in localhost

Check the php.ini. It looks off, but obviously it is actually enabled.

phpinfo zend opcache is ON in code editor
Disabling the Zend OPcache in the php.ini configuration file.  If the setting is on, then open the php.ini file and add
[opcache]
; Determines if Zend OPCache is enabled
;opcache.enable=1
opcache.enable=0
turning zend opcache OFF using code editor
Then restart your server application which created the website. This could be apache2, php -S, or apache monitor, whatever.
php server started view phpinfo
Zend OPcache has now been disabled
phpinfo showing zend opcache is OFF in localhost
Enjoy.
###
NOTE ABOUT OPCACHE from Laminas API Tools page

Disable all opcode caches when running the admin!

The admin cannot and will not run correctly when an opcode cache, such as APC or OpCache, is enabled. API Tools does not use a database to store configuration; instead, it uses PHP configuration files. Opcode caches will cache these files on first load, leading to inconsistencies as you write to them, and will typically lead to a state where the admin API and code become unusable.

The admin is a development tool, and intended for use a development environment. As such, you should likely disable opcode caching, regardless.

When you are ready to deploy your API to production, however, you can disable development mode, thus disabling the admin interface, and safely run an opcode cache again. Doing so is recommended for production due to the tremendous performance benefits opcode caches provide.

November 20, 2020

AWS Cloud Practitioner Preparation

Filed under: Amazon,AWS,Certification — georgemck @ 12:00 am

Join AWS Certification & Training Team
at AWS re:Invent 2020

Take the challenge to follow a recommended preparation path to earn AWS Certified Cloud Practitioner. All recommended training is free, including our new interactive Twitch series, AWS Power Hour: Cloud Practitioner. The best part? You can complete the preparation path just in time to get AWS Certified before AWS re:Invent 2020 – the world’s largest, most comprehensive cloud learning event. About the AWS Cloud Practioner Certificate (PDF

 

The content covers:

  • Introduction to Cloud Computing (Cloud Basics & Storage)
  • Compute & Network
  • Databases
  • Security
  • Well-Architected Framework
  • Cloud Practioner Review

 

How to participate? 

  1. Click here to Register for AWS Global Challenge 
  2. Watch the Video Series on Twitch (see list below)
  3. Take the Exam with PSI or Pearson

Cloud Practitioner Video Series
on Twitch

Cloud Basic & Storage S2 E1 (Blaine)

Watch on Twitch (59:33) Open Twitch App (59:33)

Cloud Basic & Storage S2 E1 Q&A

Watch on Twitch (30:18) Open Twitch App (30:18)

Compute & Network S2 E2 (Blaine)

Watch on Twitch (1:00:47) Open Twitch App (1:00:47)

Compute & Network S2 E2 Q&A

Watch on Twitch (30:12) Open Twitch App (30:12)

Databases S2 E3 (Jon)

Watch on Twitch (1:01:22) Open Twitch App (1:01:22)

Databases S2 E3 Q&A

Watch on Twitch (30:44) Open Twitch App (30:44)

Security S2 E4 (Jon)

Watch on Twitch (1:05:53) Open Twitch App (1:05:53)

Security S2 E4 Q&A

Watch on Twitch (30:25) Open Twitch App (30:25)

Well-Architected Framework S2 E5 (Blaine)

Watch on Twitch (59:09) Open Twitch App (59:09)

Well-Architected Framework S2 E5 Q&A

Watch on Twitch (30:46) Open Twitch App (30:46)

Review S2 E6 (Blaine, Bailey, Dion)

Watch on Twitch (1:01:51) Open Twitch App (1:01:51)

Review S2 E6 Q&A

Watch on Twitch (32:13) Open Twitch App (32:13)

Review S2 E6 (Jon)

Watch on Twitch (1:02:06) Open Twitch App (1:02:06)

Review S2 E6 Q&A

Watch on Twitch (32:13) Open Twitch App (32:13)

 

Powered by WordPress