A neat trick I learned today to remove or adjust PHP error reporting when using `WP_DEBUG`. It’s often the case that a theme or plugin author has either not written code with debug on or perhaps supporting an older version of PHP so error notices can hinder the output visually or fill up your log file. A theme I was working on that caused me to find a solution was adding 8k lines of debug output to the log file every couple hours!
In your `wp-content` folder create a new folder called `mu-plugins` and in that folder create a php file with the error level you want, for example:
//Turns off notices
error_reporting(E_ALL ^ E_NOTICE);
I you develop themes/plugins please turn on debugging and support at the very least PHP 5.4!
Developing on Windows has always been a challenge when it comes to the command line. I know powershell can do a lot, but I honestly can’t be bothered with it, especially considering I don’t work with .NET, and the regular cmd line is lacking in features to say the least.
In my quest to find a decent alternative that is not full blown cygwin, deep within the bowels of Stack Overflow I found a link to a website called MobaXterm. Pretty crummy name , but I liked the features list, it has a tiny cygwin wrapper (16.5 MB instead of 2GB +) and it was free. Maybe it could do what I’ve been looking for in terms of terminal emulation, specifically features like:
A lot of VPS’s do not have mail functionality right out of the box, so if you install a stack like LAMP or maybe a WordPress install script (like you find on Linode or Digital Ocean) , and then try to send mail via your website, you will most likely get an error.
For example if your using Contact Form 7 in WordPress you will get “Failed to send your message”, not a very meaningful error. So the first step is to troubleshoot the problem, login via SSH and type:
This should show your servers open ports, there should be a mail program in there with a mail port open to 25 and/or port 465 (or 587) for SSL. If not then you will not be able to send any mail via PHP, unless you have configured a different port or remote service, all of which can be verified.
You can further test PHP’s mail by sending a test email using PHP’s command line or putting the following into a PHP file.
mail ( 'email@example.com', "Test mail", "Test mail from your server name" );
Zend OPcache is the new open source opcode PHP cache that is now bundled with PHP 5.5. I had just upgraded one of my servers running Ubuntu 12.04 to use Apache 2.4.6 and PHP 5.5.4.
So how does one install it? I initially thought I had to just edit the php.ini file since there are a bunch of new settings for the opcache. I set mine similar to the recommended default and did not enable `cli` caching.
Restarting Apache however and I saw that it was still disabled , even though I had also set