SUPHP and 404 error on POST

Advanced Questions & Problems

SUPHP and 404 error on POST

Postby adrianmmorgan » 3:08pm, Fri 17 Jun, 2011

Hi,
I am getting a 404 error when Worldpay is doing a callback request to one of my Shopperpress pages (www.greenfrogdesigns.co.uk/callback/). The page works fine as I have tested it with a Javascript webpage
(www.greenfrogdesigns.co.uk/posttest.htm) using the Worldpay request, which is:

POST /callback/?installation=239267&msgType=authResult HTTP/1.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Host: http://www.greenfrogdesigns.co.uk
Content-Length: 806
User-Agent: WJHRO/1.0 (WorldPay Java HTTP Request Object)

authAmountString=%26%23163%3B289.00&_SP.charEnc=UTF-8&desc=Cart+Order...etc...etc...

Worldpay suggested it might be a data encoding issue as the content type for their payment response (callback) is as follows:

Content-Type: application/x-www-form-urlencoded

They suggested that the server needs to recognize the data type. I tried setting up a new user-defined MIME TYPE "application/x-www-form-urlencoded" with Extension "x-www-form-urlencoded" but this didn't work - so I may have set the wrong extension.

Research on the web, meanwhile, showed it might be due to security on the webserver, and the fix was suggested as editing .htaccess to include the lines:

<IfModule mod_security.c>
SecFilterInheritance Off
</IfModule>

I put this in my .htaccess file but it didn't make any difference.

I contacted my hosting provider whose response was the following:

************************ from hostpapa **********************
You're on the right path, if my information is correct.

We run what is called suPHP - a secure PHP variant. With it, PHP scripts are more secure. You can still run the command you wish (as per your email), however, you would place rules like this in a php.ini file, and have a line of code in your .htaccess that calls on the php.ini file.

However, while this might work for you(it undoubtedly should), coding like this is completely unsupported. In order to find the code for your .htaccess you may wish to do a google or other search for the required code.
************************ from hostpapa end **********************

I also found this on the web "I knew from experience that my host uses suphp, so I took a gander at the section about 500 errors and
.htaccess files and sure enough, removing the commands in the .htaccess file and creating a php.ini file solved my problem. Just
wanted to let you know that for whatever reason, my htaccess misconfiguration was throwing a 404 instead of a 500. "

Unfortunately, while I used to be coder (many moons ago) I know nothing about PHP, hence this post. I am hoping that the gurus on this forum can solve the problem for me (and give simple instructions on exactly what to do) . This is my current .htaccess file:

*************** .htaccess file ****************
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
<IfModule mod_security.c>
SecFilterInheritance Off
</IfModule>
# END WordPress
AddType application/x-www-form-urlencoded x-www-form-urlencoded
*************** .htaccess file ****************


I am guessing I need to put php.ini in my root directory (the one above public_html as it shouldn't be publicly visible) so I am guessing I should add this to my .htaccess file:

suPHP_ConfigPath "/php"

Perhaps you could verify that this is correct.

But what on earth do I put in the php.ini file? (I know nothing about PHP, I am afraid, so I am hoping you can help)

many thanks
adrianmmorgan
phpList newbie
 
Posts: 1
Joined: 3:00pm, Fri 17 Jun, 2011

Return to Advanced Questions & Problems

Who is online

Users browsing this forum: No registered users and 2 guests

cron