You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 characters
# Params for php-resque
QUEUE : The name of the queues to poll
INTERVAL : The polling interval (waiting time in seconds between each polling). Default to 5 seconds.
APP_INCLUDE : Path to your application autoloader. Workers need to know where to find your jobs classes
COUNT : Number of workers to create. All workers will have the same properties. Will always create one worker by default.
REDIS_BACKEND : Address of your Redis server, formatted as hostname:port. e.g: 127.0.0.1:6379, or localhost:6379. Default to localhost:6379
VERBOSE : 1 to enable verbose, will print basic debugging informations
VVERBOSE : 1 to enable advanced verbose, will print detailed debugging informations
# convert to timestamp and back to other formats
$d = DateTime::createFromFormat('j.m.Y', '26.02.2019');
echo $d->format('U');
print "\n";
echo $d->format('Y/m/d');
# Converting an Epoch Timestamp to Time and Date
# Parts
$when = new DateTime("@163727100");
$when->setTimezone(new DateTimeZone('America/Los_Angeles'));
$parts = explode('/', $when->format('Y/m/d/H/i/s'));
// Year, month, day, hour, minute, second
// $parts is array('1975', '03','10', '16','45', '00'))
The amount of memory (in megabytes) allocated for the opcode cache. This
should be large enough to store the compiled opcode for all of your application’s
PHP scripts. If you have a small PHP application with few scripts, this can be a
lower value like 16 MB. If your PHP application is large with many scripts, use a
larger value like 64 MB.
opcache.interned_strings_buffer = 16
The amount of memory (in megabytes) used to store interned strings. What the
heck is an interned string? That was my first question, too. The PHP interpreter,
behind the scenes, detects multiple instances of identical strings and stores the
string in memory once and uses pointers whenever the string is used again. This
saves memory. By default, PHP’s string interning is isolated in each PHP process.
This setting lets all PHP-FPM pool processes store their interned strings in a
shared buffer so that interned strings can be referenced across multiple PHP-
FPM pool processes. This saves even more memory. The default value is 4 MB,
but I prefer to bump this to 16 MB.
opcache.max_accelerated_files = 4000
The maximum number of PHP scripts that can be stored in the opcode cache.
You can use any number between 200 and 100000. I use 4000 . Make sure this
number is larger than the number of files in your PHP application.
opcache.validate_timestamps = 1
When this setting is enabled, PHP checks PHP scripts for changes on the interval
of time specified by the opcache.revalidate_freq setting. If this setting is dis‐
abled, PHP does not check PHP scripts for changes, and you must clear the
opcode cache manually. I recommend you enable this setting during develop‐
ment and disable this setting during production.
opcache.revalidate_freq = 0
How often (in seconds) PHP checks compiled PHP files for changes. The benefit
of a cache is to avoid recompiling PHP scripts on each request. This setting
determines how long the opcode cache is considered fresh. After this time inter‐
val, PHP checks PHP scripts for changes. If PHP detects a change, PHP recom‐
piles and recaches the script. I use a value of 0 seconds. This value requires PHP
to revalidate PHP files on every request if and only if you enable the opcache.val
idate_timestamps setting. This means PHP revalidates files on every request
during development (a good thing). This setting is moot during production
because the opcache.validate_timestamps setting is disabled anyway.
opcache.fast_shutdown = 1
This prompts the opcache to use a faster shutdown sequence by delegating object
deconstruction and memory release to the Zend Engine memory manager.
Documentation is lacking for this setting. All you need to know is turn this on.
max_execution_time = 5
The max_execution_time setting in your php.ini file determines the maximum length
of time that a single PHP process can run before terminating. By default, this is set to
30 seconds. You don’t want PHP processes running for 30 seconds. We want our
applications to be super-fast (measured in milliseconds). I recommend you change
this to 5 seconds: