Fix Strange “Headers already sent by” in Line 1 PHP File

"Cannot modify header information - headers already sent by" error is most common PHP error happen when we develop a web application. Usually when we want to redirect or send cookie. I used to get that warning a lot long time ago. But since i standardize my PHP code, it doesn't happen for a while now, until last night. Yesterday night i was fixing somebody else code and audit the performance as well as the security. But when testing it, i got very strange error, the error was "Headers already … Read more...

Use PHP Code Sniffer (phpcs) in Sublimetext 3

Today i found a great plugin for Sublimetext 3, it is called sublime-phpcs on Sublimetext 3. This plugin is to check if my php code is good according to the PHP Standard (PSR-1 and PSR-2). After the  default installation, the plugin was not working and return a lot of errors. So i dig around a bit and finally it is working now. Below are the requirements and how to install it (note that i'm on Ubuntu 14.04): PHP Pear PHP Code Sniffer (phpcs) Pear Package PHP Depends Pear … Read more...

PHP Script To Test Send Email

Sometimes sending email could be pain in the ass for some server. Especially if it is a share hosting that has blacklisted IP, and all the emails it send either go to spam box or doesn't deliver at all. As one of my services, is deploy a web application and most of the time sending email from my staging server is completely fine, but not in the client hosting server. So because i'm checking it over and over, in my free time i create a simple script to send email from the server. If you are … Read more...

Jump Start Your Web Application With PHP Composer

If  you are a web developer and love to use PHP, i bet you have heard about composer. Composer is dependency manager for PHP. So what is dependency means? In developing a web application you may need to use one or more libraries. In my case i often use these libraries: monolog, slim, laravel, debug helper, and laravel. Without composer it would take me hours just to do the environment setup. With composer i just need to define a composer.json file, and composer will handle the rest, … Read more...

Create Local VirtualHost For Your Development Environment

If you are using xampp, you can access your local server just by go to http://localhost. So now i would like to share to you how to create your own local domain and add your local domain into apache virtual host, so you can have your local website for development purpose. For example you can have www.domain.local. To create this you only need to edit your apache vhost and your hosts file. If you are using Windows you can edit your hosts files in C:\Windows\System32\drivers\etc\hosts, you can … Read more...

DB Cache Reloaded Fix on Github

First of all i would like to thanks all of you that already support me and using DB Cache Reloaded Fix plugin. And also i would to apologize if lately the DB Cache Reloaded Fix development is delayed. I also keep reading the WordPress forum for my plugin development, and there are some nice idea and fixes that need to be implemented, but i really busy at the moment since i just build my own company. And there are many things on my plate to do. And there some brilliant developers ask me if … Read more...

DB Cache Reloaded Fix v2.2.4 Released

I'm happily to announce DB Cache Reloaded Fix v2.2.4. For you who don't know DB Cache Reloaded Fix, it's a WordPress plugin to cache the queries made to the database whereas improve your WordPress blog performance. It's not originally mine, but it is a fork from the old DB Cache Reloaded which not compatible since WordPress 3.1. And thanks for all of you, your input and feedback is really helpful. What's New in DB Cache Reloaded Fix v2.2.4 There are some fixes that will definitely improve the … Read more...