Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes)

Add the following at the top of wp-config.php: ini_set(‘memory_limit’,’128M’); Although you should use WP_MEMORY_LIMIT when you can, we see in /wp-includes/default-constants.php that WordPress doesn’t do much more than use ini_set itself. Note: This is just one more thing to try, but you’ll likely end up having to have your host fix this issue.

Declaratively Configuring WordPress in XML or JSON or YAML

I created a build script using Phing which has an XML based configure syntax (build.properties), which is based on Apache Ant (Java). It currently supports: Installing WordPress and DB Installing any plugins and themes from external urls (zip or gzip format) Adding config details like site title, login name/pass, email (more can be added if … Read more

WordPress PHP error handling and reporting in production environment

It’s best to just log errors to the server and then use bash or a server script that supports email and error analysis (instead of PHP). There are lots of log file tools out there, simple ones like Logwatch, Swatch, Octopussy, or more complex ones like Nagios. For errors which are triggered using WP_Error you … Read more

Generate WordPress salt

Does WordPress core has this function defined somewhere? While I haven’t used it, you are probably looking for wp_salt or wp_generate_password. wp_salt is located in wp-includes/pluggable.php. can these salts be generated randomly Yes, of course. are there any specific rules for creating them There is no specific rule. The generic rule is to create long, … Read more

Permalink Issues by Installing WordPress in Subdirectory / Subfolder

What I generally do Install WP in sub directory. Open permalink set required permalink. Open settings->general link Remove the sub directory name from ‘Site Address (URL)’ Cut the index.php and .htaccess files from sub directory and paste them to root change code in index.php as you did. Again access settings->permalink save the form Done. You … Read more

Is there a way to define wp_blogs domains in wp-config?

When WordPress loads multisite, it includes the relevant MS specific files in wp-settings.php The relevant lines: <?php // Initialize multisite if enabled. if ( is_multisite() ) { require( ABSPATH . WPINC . ‘/ms-blogs.php’ ); require( ABSPATH . WPINC . ‘/ms-settings.php’ ); } elseif ( ! defined( ‘MULTISITE’ ) ) { define( ‘MULTISITE’, false ); } … Read more