January 16, 2017

Against All Odds…

Life often puts us in situations where you think, “Now that’s just next to Impossible!”. Remember, these are the times when God proves Himself. It is amazing how you feel like God never comes to rescue when you can change things with your own strength. He only steps into the scene when you’ve given up; have no hope for it whatsoever. It’s when you say, “There is no way I can do it!”. This is the time He steps into the scene and says “That’s why I am here!”. I have seen this happen time and time again. His ways are so different to ours.

These days, when I know something just can’t happen…I am reminded of this verse in the bible “…Is anything too hard for me?” (Jeremiah 32:27). As of now, I feel like whatever I am in, It is impossible for things to change. I feel like they are irreversible. I know for sure that there is no way I can do something to change things around. It’s out of my hands. But if I had to answer the question God poses to each of us, I would say “No!”. Nothing is hard for the Lord!

Believe in the Impossible…Have a little Faith! Hold on to what you once thought was just not possible because God is about to change that. If it’s God will, He will make it come to pass. His words are too powerful. When He says something, It doesn’t come back to him empty. It is done!

January 12, 2017

Solve Nginx+PHP-FPM Access Denied Issue

Recently one of our services went down due to an Apache upgrade that caused Htaccess to have contents that are no longer supported. When we go to our app, it throws out an “Access Denied” error. Our developers looked into all sorts of possible scenarios including

  1. IonCube Issues
  2. File Permission Issues
  3. Owner/User Group Issues
  4. Directory Index Issue

After a quick research, a lot of people who experienced issues with this suggested solution that involves modifying the PHP-FPM configuration file. Apparently, if the security.limit_extensions directive is set to specific file types, it won’t parse PHP in other file types causing an error such as “Access Denied”.

So we set the security.limit_extensions directive to parse .html files as well and restarted the PHP-FPM. Unfortunately, this didn’t solve the problem for us. We had to modify our Htaccess file to contain a “?” which fixed the syntax issue and thereby fixing the issue we were facing with “Access Denied” page.

Here’s how we did it…

Our original Htaccess File Contents:

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond $1 !^(index\.php|images|robots\.txt)
  RewriteRule ^(.*)$ ./index.php/$1 [L]
</IfModule>

This worked fine until the Apache was upgraded. This following RewriteRule syntax is no longer supported.

RewriteRule ^(.*)$ ./index.php/$1 [L]

The corrected RewriteRule is:

RewriteRule ^(.*)$ ./index.php?/$1 [L]

The difference is in the “?” mark after the index.php

That fixed the issue for us. After upgrading the Apache, it is always good to check if all the sites are working and if your Htaccess file contains correct syntax. Hope it helps someone out there having similar issues.

Older Posts