Solved Centos 5.8 Error in php.ini

You could be experiencing this after the cpanel upgrade and here’s how we got this addressed. This was throwing the crons out of gear as well. You need root access on SSH on the server.

[root@host]~ >> php blah.php
PHP:  Error parsing /usr/local/lib/php.ini on line 793

Open the file /usr/local/lib/php.ini

nano /usr/local/lib/php.ini

Press ^_ and enter 793

Change the following line

url_rewriter.tags = a=href,area=href,frame=src,input=src,form=,fieldset=

to the one below or simply add the double-quotes

url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

It didn’t even require a restart.

Weird 500 internal server error on WordPress – Resolved!

The recent CentOS 5.x systems have mod_security built in and the 2.x doesn’t allow overriding it on .htaccess and this causes a lot of heartbreaks to folks that want some basic things done on wordpress and a lot of other software. This post deals with getting around it for wordpress.

You post something really harmless and you are shown a 500 error page. The local error_log contains nothing in it and you need the server access (root) and if you don’t have it, I don’t think you’re getting anywhere. Stuff explained here on would require shell access. I’m thinking of doing one for using SSH but at a later date. From here on, I assume that you have root access to the server and know how to work with shell access.

Here’s what you do – locate the error_log on the system. Shell into your machine as root.

grep ErrorLog /etc/httpd/conf/httpd.conf

It should tell you where the file is and the next step you need to invoke the error – reproduce the 500 error so that we have it at the tail of the file and

tail /etc/httpd/logs/error_log

You will notice something like — for obvious reasons, I’m not including the whole thing

ModSecurity: Access denied with code 500 (phase 2).
Pattern match "((alter|create|drop)[[:space:]]+
(column|database|procedure|table)|delete[[:space:]]+from|update.+set.+=)"
at ARGS:content.
[file "/usr/local/apache/conf/modsec2.user.conf"]
[line "352"] [id "300015"] [rev "1"] [msg "Generic SQL injection protection"]
 [severity "CRITICAL"]

What we found here is the security that it is trying to prevent you from doing some SQL injection stuff – Let’s not go into the details – I didn’t even bother to – All that we need to locate is the whitelist file where we’re going to add some stuff.

nano /usr/local/apache/conf/modsec2.user.conf

should tell you the location of the whitelist at /usr/local/apache/conf/modsec2/whitelist.conf – Press Control-X to exit the editor. I used the editor so that you’ll notice the location which is right on top – 3rd line or so.

nano /usr/local/apache/conf/modsec2/whitelist.conf

To this, we’re going to add a set of rules that would allow WordPress to work as desired. I took this from a blog post. In fact, I’ve only added some bells and whistles to what this genius has done already.

# Added for Worpress Operations
<LocationMatch "/wp-admin/post.php">
  SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904
  SecRuleRemoveById phpids-17
  SecRuleRemoveById phpids-20
  SecRuleRemoveById phpids-21
  SecRuleRemoveById phpids-30
  SecRuleRemoveById phpids-61
</LocationMatch>
<LocationMatch "/wp-admin/admin-ajax.php">
  SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904
  SecRuleRemoveById phpids-17
  SecRuleRemoveById phpids-20
  SecRuleRemoveById phpids-21
  SecRuleRemoveById phpids-30
  SecRuleRemoveById phpids-61
</LocationMatch>
<LocationMatch "/wp-admin/page.php">
  SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904
  SecRuleRemoveById phpids-17
  SecRuleRemoveById phpids-20
  SecRuleRemoveById phpids-21
  SecRuleRemoveById phpids-30
  SecRuleRemoveById phpids-61
</LocationMatch>
<LocationMatch "/wp-admin/options.php">
  SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904
  SecRuleRemoveById phpids-17
  SecRuleRemoveById phpids-20
  SecRuleRemoveById phpids-21
  SecRuleRemoveById phpids-30
  SecRuleRemoveById phpids-61
</LocationMatch>
<LocationMatch "/wp-admin/theme-editor.php">
  SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904
  SecRuleRemoveById phpids-17
  SecRuleRemoveById phpids-20
  SecRuleRemoveById phpids-21
  SecRuleRemoveById phpids-30
  SecRuleRemoveById phpids-61
</LocationMatch>
<LocationMatch "/wp-includes/">
  SecRuleRemoveById 960010 960012 950006
  SecRuleRemoveById phpids-17
  SecRuleRemoveById phpids-20
  SecRuleRemoveById phpids-21
  SecRuleRemoveById phpids-30
  SecRuleRemoveById phpids-61
</LocationMatch>

Go to the end of the file and paste all this into it. If you’re using PuTTY for windows, copy the content to clipboard, scroll to the end of the file and press right-click and you’ll thank me a million times. Infact, you can paste all of the commands using right click. Press Control-O to save the file and Control-X to exit.

Now, you need to restart the webserver – httpd

/etc/init.d/httpd restart

Another weekend to tickle my geeky nerves and the error. I personally prefer to work on Debian but this one talks about CentOS – most customer use CentOS – rather they are sold CentOS.

Hope this helps someone – Please leave your questions, comments and feedback here and I’ll try and come back to you.

What motivates us? The surprising truth

Have you wondered what motivates us? Watch this video, it might certainly tell you the secret. Well, lot of us don’t believe this – which is why we’re a lot :)

But truly though, the purpose and the mastery seem to overtake a lot of other material concepts.

We’re hiring

Over the next week, we’ll be reviewing the applications that were sent at http://bit.ly/cKgAoz and shortlisting candidates. Please apply using the form and refer your friends. More details on the link provided above.

We’ll be finalizing the hiring process as soon as possible and move on to the ramp up program. The training program for freshers that was planner earlier is still on hold and we intend to get back on it after the project pressures subsides – Don’t know when? :)

Skype Startup Blues

Every time the cool skype gets an upgrade, the start-up nightmare starts. You start getting emails that complain about your online absence. Here’s how you can get over it. Start Skype. Go to Tools > Options and Uncheck the option to Start skype when Windows starts and close.


You can restart at your convenience and skype doesn’t start anyways… Now go right there and check it back again and this time when you restart – you’ll notice that you’re on!

BTW – I know it’s been a while since anything got posted here. But I hope to more regular ;-)

IP to Location

Most occasions we depend on certain web services that pump so much of ads to support their interface. We built our own using the binary database maxmind has for free. We spiced it up with some map so that it’s more visual. We’ll be making that an optional feature controlled by the URL very soon.

ip2location | arroWebs labs

Earlier, only the country data was available – which it claims is still very accurate but what has been used here is their lite data for the city info across the globe. One thing that must be noted is that the IP information provided by these databases do not have direct relationship with the location of the user but the location where the IP range has been allocated. So, when we use our ISP, BSNL to connect, we get at least two IP ranges – one from Udaipur and another one from Jaipur.

The sad truth still is that the coordinates of Udaipur are wrong even in this – i guess they took it from a wrong geolocation.

Another update to the site

arroWebs website gets another update. We have added a host of new projects that we worked on as we crossed over to the new year. Please check out the What we’ve made section and explore the various things we’ve recently done.

Save MySQL!

If Oracle buys MySQL as part of Sun, database customers will pay the bill.

In April 2009, Oracle announced that it had agreed to acquire Sun. Since Sun had acquired MySQL the previous year, this would mean that Oracle, the market leader for closed source databases, would get to own MySQL, the most popular open source database.

arroWebs.com gets a facelift

It’s been long time coming. There had been at least three attempts lately and they had to be shelved :( . We just keep our fingers crossed and hope that you all will continue to support us as you have always been. Do update your bookmarks as the site now moves to the root and will continue to be so.

Visit the site now and let us know your thoughts and feedback.

Google Dance – heard of it?

Another SEO jargon – This is something that you better pay heed to. It seems like when google updates their servers with the crawled information, their test servers and the main results show different outputs. There are many tools that help quickly display the results side by side to compare.

Here’s a quick one that we put up at labs.arrowebs.com/googledance/. If you have comments, please post them here and we’ll get back with necessary updates to the tool. Though there are many on the web, this one is attempted to provide a very simple interface with no bells or whistles – sounds googlish? eh!