Skip to content

Instantly share code, notes, and snippets.

Avatar

Matteo D. fromthestone

View GitHub Profile
@fromthestone
fromthestone / php-pools.md
Created Mar 4, 2019 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)
View php-pools.md

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
View disable-plugins-when-doing-local-dev.php
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@fromthestone
fromthestone / .htaccess
Created Aug 7, 2014
Redirect a WP installation that is hosted in a subdirectory without losing the chance to keep your WP files into another subfolder
View .htaccess
#Use this .htaccess if your WP is hosted in a subdirectory and not in the ROOT of the webserver.
#install this file in yourwp directory and not in the ROOT
#Change your_dir with the right name
#We assume that you installed WP into a subdirectory called yourwpinstallation and you want show the website www.wpwebsi.te/yourwp/
#for Example www.wpwebsi.te/yourwp/yourwpinstallation => RewriteRule . yourwp/index.php [L]
# BEGIN WordPress
<IfModule mod_rewrite.c>