This webpage is not available ERR_CONTENT_DECODING_FAILED – PHP ob_start() ob_gzhandler – Trailing spaces after closing ?> in WordPress Plugin
Recently we ran into an issue where a website would not load. We traced the problem to a line in the code which attempted to pass all content to ob_start(‘ob_gzhandler’).
This basically words to zip up all content and send it to the browser. However an error was being thrown ERR_CONTENT_DECODING_FAILED, which showed up in the browser window and in the browser console. After some detailed debugging in PHP using some die commands()
I found that the issue came from an rogue blank character which displayed before the ob_start(“ob_gzhandler”) function could be called.
There were a couple of ways I could deal with this, first I could simply put an ob_start() at the top of the code, and then put an ob_get_clean(); just before the ob_start(‘ob_gzhandler’), however this felt a bit sloppy, so I went in search of the rogue character.
The application that this was in, was one that simply included the wordpress load file so that it could integrate with a WordPress installation, and I found that the characters was coming from the WordPress install. Using a hunch I decided d to look for a recently updated plugin and I quickly found a plugin that had an end php tag “?>” with an extra line after it.
I quickly fixed this and then decided I would figure out a way to quickly identify issues like this. While there are many ways to address this and figure out how to over come it, the issue seems to identify an need to figure out whether plugins conform to some best practices (such as omitting a closing ?> php sign)
If we identify this need, we will write a free plugin to put on the WordPress site, which will go through all plugins on sites to confirm that they use some best practices such as this.
Invalid command ‘SSLEngine’, perhaps misspelled or defined by a module not included in the server configuration – enable apache ssl module
If you are moving an existing Apache configuration file from one server to another, or if you are enabling SSL configuration on an existing website, you could run into this error as you restart apache
server#/etc/init.d/apache2 restart Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration
This essentially means that Apache doesn’t understand what the SSLEngine command means. This is most likely because SSL has not been enabled on this server. For quite some time SSL has come with Apache2 by default, however you do still have to enable it.
To enable it you can simply run enable the ‘ssl’ apache module the command
#a2enmod ssl #/etc/init.d/apache2 reload #or #/etc/init.d/apache2 restart
The error should no longer show a the SSLEngine command is correctly recognized by the ssl mod.
proftpd stops running – once a week when logrotate.d runs
On Sunday mornings at 6:30AM I receive this log entry at the bottom of my /var/log/proftpd/proftpd.log file and proftpd stops running
2015-07-05 06:28:24,870 servera proftpd 127.0.1.1: ProFTPD killed (signal 15) 2015-07-05 06:28:24,871 servera proftpd 127.0.1.1: ProFTPD 1.3.5rc3 standalone mode SHUTDOWN
The time (about 6:30AM) on sunday leads me to know from experience that is when the log files rotate if they are set to rotate weekly using logrotate.
So I go in search of the logrotate commands for proftpd with grep and find the following file
#grep proftpd -l /etc/logrotate.d/* /etc/logrotate.d/proftpd-basic
Inside of /etc/logrotate.d/proftpd-basic file, there is a command which restarts proftpd after the logs files are rotated
postrotate # reload could be not sufficient for all logs, a restart is safer invoke-rc.d proftpd restart 2>/dev/null >/dev/null || true
When I run this at the CLI, I find that every other time I run the command, proftpd does not start! This seems to me to be a timing issue, so I simply but a sleep command between the stop and start commands in the restart script
/etc/init.d/proftpd force-reload|restart) if [ "x$RUN" = "xyes" ] ; then signal stop 1 sleep 1 #ADDED BY Michael Blood to avoid a timing issue that would not allow the start if the stop did not complete. start
This appears to fix the problem perfectly.
Error While Installing PGAdmin v1.20.0 for Windows
Download the latest version. At the time of this post it was v1.20.0.
Unzip the file and run the .msi file.
I encountered an error after the installation when running the program to the affect of:
MSVCP120.dll is missing
This file relates to Microsoft Visual C++. The redistributable package can be found here:
After downloading and installing the x64 package (I’m running Win7 x64), I still encountered the error.
This problem was resolved by downloading and installing the x86 package.
Fixed ActiveX error: Automation Error: the object invoked has disconnected from its clients
We have a custom ActiveX Applet we built which was randomly throwing this error, it was happening on a new machine only and it was rather random. Automation Error: the object invoked has disconnected from its clients
Sometimes the error did not happen at all. The new machine had a fresh install of XP on it. Lots of other new XP machines were not running into the problem.
We researched and found that the problem always happened during some sort of usage with the “MSINET.OCX” activex object. This led us to an article on Microsoft’s support site with this article.
Turns out the new machine was dual core which somehow caused problems with threading of the object, the problem was fixed on a later version of Visual Studio so if I redeployed the application with the latest MSINET.OCX object it should have worked. As a quick fix though I downloaded a later version MSINET.OCX to the machine and reregistered it so that the system would use that object.
regsvr32 /u msinet.ocx
Voila, no more random error.
DPM Error 337: Manually Set Name of Allowed DPM Server on Client
When installing a Protection Agent from DPM 2007 on a server on a Windows 2003 Domain I ran into a wacky problem where the DPM Administration Console errored out during Install.
A server errored out with a 337 error.
You cannot install the protection agent on MYSERVER because access to the computer has been denied.
The Microsoft Documentation says that the recommended action is “Do the following to troubleshoot this issue: ”
1) If another DPM server is currently protecting MYSERVER use that DPM server to uninstall the protection agent from MYSERVER. Then, use this DPM server to install the protection agent on MYSERVER.
2) Verify that the time on the DPM server and the selected computer is synchronized with the domain controller. At a command prompt, type “net time /set” to synchronize the time with the domain controller.
3) If the computer is a domain controller, verify that the primary domain controller (the PDC Emulator) is running Windows Server 2003 with Service Pack 1 (SP1), and that Active Directory has completed replication between the domain controllers since the Windows Server 2003 SP1 installation.
So I start debugging with item 1. Since I am not the first Administrator to work on this installation AND there is another DPM server located elsewhere on the network which was recenctly installed, it seems possible that something odd was done with this computer wpointed to another DPM Server.
First I try uninstalling the client locally on the system and I log into the server to remove the program using Add/Remove Programs, however the Add/Remove Programs listing is completely blank. I do a bunch of research on this and eventually I determine that the Unistall information must somehow be corrupt, the system needs a OS restore or something. I cant afford this and will plan to do this another day. I start browsing around in the Program Files directory for the DPM Client to try and find an uninstall program or something and I happen upon an executable that looks interesting. I open a command prompt and run the program to find out what it does.
#> cd C:Program FilesMicrosoft Data Protection ManagerDPMbin
#> setDPMServer.exe /?
This shows me how to run this program
#> SetDPMServer -dpmservername < servername>
So I run it with the name of my DPM server
#> SetDPMServer -dpmservername MYSERVER
And it clearly does something giving me the following information.
Configuring dpm server settings and firewall settings for dpm server =[MYSERVER]
Configuring dpm server settings and firewall settings for dpm server =[W2K.DOMAIN.COMMYSERVER]
Configuration completed successfully!!!
Now I head back over to my DPM server and run the install again from the Management Tab of the DPM 2007 Administrator Console. And would you beleive it? It installed perfectly. So there are two things I need to get in order to address the other issues on my network (find out why Add / Remove Programs is not coming up, find out if anyone is trying to protect some of the computers using another DPM server on the network).
The thing I never found out was if it could have been items 2 or 3 where there is a time sync problem between the AD controller and the server. It might have been better to start with the easy fixes described in those steps since that would have been easier and would have ruled it in our out.
Until then though this will work; Mystery Solved!