Archive for the ‘php’ Category

PHP: Setting Up XDebug with KCacheGrind

Thursday, July 26th, 2007

KCacheGrind is a very useful tool to identify bottlenecks in your applications. This will explain the steps to using it to find issues with your PHP scripts. For me, the scripts are all web pages. I'm already assuming you're running a current version of PHP. I did this ...

PHP compile error on CentOS Install

Sunday, July 15th, 2007

I installed CentOS 5 on my VMWare a few days ago. I installed gcc via yum, compiled and installed libxml2. I then tried to install PHP 5.2.3 and received this error: configure: error: installation or configuration problem: C++ compiler cannot create executables. It took me forever to figure this out, ...

10 (very) Basic Tips for PHP Web Application Security

Friday, February 23rd, 2007

Barebones list for the things you should be looking for when developing a web app in PHP. Some of it applies to all web apps, not just PHP. Use HTML_Safe (or a similar javascript stripping library) to check for and remove javascript when you're accepting data that will be output ...

What caused that load spike?

Tuesday, February 13th, 2007

Every now and then, we find that we will have a sudden increase in the number of apache processes, load average will spike up, and then go back down to normal. In rare cases, we will see the same thing happen, and the load avg spike WAY up, all ...

Calling a function from within preg_replace

Thursday, October 12th, 2006

Regular expressions are awesome. However, sometimes doing everything in them is extremely difficult, or impossible. Luckily, we can flex the power of preg_replace's 'e' option to execute the replacement string as PHP code. The reason why I found this is was I was looking for a suitable URL auto-linker ...

Pretty URLs using Multiviews

Thursday, October 12th, 2006

I saw a post on digg.com about how it's nice to have "pretty urls" that are easy to tell people. While i'm not sure anyone would remember rustyrazorblade.com slash some ridiculous post name, it's nice to have for search engines. Unfortunately, it didn't really go into detail about ...

PHP 5.1.4 Install on Intel Mac (Bug?)

Wednesday, August 16th, 2006

I noticed after installing PHP 5.1.4 on my brand new MacBook Pro that my scripts weren't executing. After about 3 hours of messing around, I realized that short_open_tag was turned off in php.ini. Location: /usr/local/php5/lib/php.ini Should be: short_open_tag = On Not sure if this is a common issue, or if the PHP ...