Modify PHP CLI Include Path Dynamically

I was working with an application platform that I had just downloaded today. I just wanted to check it out and play with it a bit. In the application framework was an executable script that provided some command line utility. I fired up the script and received an error like “PHP Fatal error: require_once(): Failed opening required…”. Of course non of the files from the downloaded archived were in the include path for my system, but I didn’t want to just go adding it to my php.ini file just to play around with it short term. What to do.

Command Line Options

First I wanted to see if there was a command line option that I could pass to PHP to tell it what include_path to use for just this one execution. If you execute the following you’ll see the usage:
php --help
There is no include_path command line option, but there is the -d foo[=bar] option which allows us to modify any of the INI entries by key/value.

Read more

Cleaning Up HTML Code

I love (sarcastically) cleaning up other people’s HTML code. For instance I just found this little snippet.     So let me get this straight… in this table column you want a single space, formatted with”Arial, Helvetica, sans-serif” font of size 2. Then you want to follow that with another single space formatted with the …

Read more

Writing A WordPress Filter To Modify Post/Page Titles

I was recently working on a new WordPress theme when I had need to modify the title of pages before output. The style I was attempting to use involved wrapping <span> tags around the title (inside of the href tags). The wp_list_pages() function returns pages (which are basically the same as posts) and has several …

Read more

How Can I Recover My Lost MySQL root Password?

Many people use the MySQL open source relational database server. Mostly for websites, but I’ve also seen it used elsewhere. One problem that I recently ran into with my local development installation is… “what was my root password again?” Aaaggghh! OK, sorry. Don’t panic; it can be recovered. A quick survey of the internet and …

Read more

View Source Chart – A Firefox Extension

A couple of weeks ago I wrote an article titled Instant Source – Hacking Websites The Easy Way. It covered the Internet Explorer extension Instant Source, which allowed a much more informative view source functionality. I really liked this extension BUT being an IE only program I set out to find a Firefox alternative. View …

Read more