-
SpotVPS First Impressions
After the unfortunate incident last week with NordicVPS, I decided to look for a new VPS host. As usual, I went to lowendbox and get the reviews in webhostingtalk. It’s there where I stumbled upon a promo from SpotVPS. As it turns out, SpotVPS is a low-cost VPS offering of ComfortHost.NET. And who are they?…
-
LAMP Install on VPS : CentOS5+Apache+MySQL+suPHP
Here’s the work-in-progress instructions for setting up a LAMP. It’s been sitting on my draft for ages and I have to publish it because a few of my friends need it. **** NOTE : If you notice, it’s still a draft. It came from a number of sources but these are the steps I use.…
-
Automatically Convert Emails to NoSpam
To prevent spam comments on one of the sites that I maintain, I send for approval any comment with at least one URL or email address in it. In that way, manual spammers will find no incentive on leaving comments on the site. At the same time, email addresses left by commenters will not be…
-
Upgrading to PHP 5.3 for CentOS
I wanted to try WordPress 3.2 beta but realized that it requires at least PHP 5.2 and I’m still with 5.1.6 (the one that comes with CentOS). Here’s what I got from the interwebs. Step 1: Get webtatic PHP 5.3 Repository rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm Step 2: Update PHP yum –enablerepo=webtatic update php Step 3: Verify…
-
Shopping Cart Always Empty
After using suPHP on my Apache webserver and NGINX on another server, I realized that my cart systems are no longer working. Here are the symptoms I noticed. AJAX Carts does not display items When clicking checkout, the cart becomes empty After clicking update, the cart becomes empty If you look at the symptoms, you’ll…
-
NGINX – 502: Bad Gateway
One of my VPS on NordicPVS went down today and after restarting, I got a number of weird errors. Apparently, the contents of my VPS were wiped-out. Though I managed to solve most of the problems (mostly by restoring the backup), I kept getting the 502: Bad Gateway error. I told myself that this can’t…
-
Datetime value to string in PHP
This one escapes me everytime I need which results to much googling. The function is to convert SQL datetime value to human-readable format. /* * Converts the likes of ’2010-08-01 14:57:15′ to ’August 1, 2010, 2:57 pm’ */ $datetime_value =”2010-08-01 14:57:15″; echo date( ”F j, Y, g:i a”, strtotime( $datetime_value ) ); Here’s another example which you will see on some of my templates. <?php echo date(‘Y-m-d’, strtotime(‘next month’)); ?> For more formats, go head to…
-
How to Get Apache & PHP version in Shell
Aside from using phpinfo(), you can also use some shell commands to view the apache or php versions you are using. NOTE: This is in CentOS 5.
-
Adding New Array Key in PHP
In adding a new array key, we’ll need to know two array functions called array_key_exists and array_merge. First, let’s take a look at array_keys. It’s a function that returns an array containing the keys of an array. <?php $a = array(“foo”=>”1″,”bar” => “2″); $keys = array_keys($a); print_r($keys); ?> Second, of course, is array_merge. As the…
-
How to Find PHP.INI Path
If you can’t find it in /etc/php.ini, then you have to use ssh and execute the command below. php -i | grep php.ini The command will return something like Configuration File (php.ini) Path => /etc/php.ini
Recent Comments