Items filtered by date: December 2015

Sunday, 07 June 2015 11:41

Diagnose cURL connections

These following will help you diagnose cURL connections, if cURL is connects to the other end, SSL and how to enable cURL.

What is my cURL IP address?

This is not always as obvious as you think. If you are on a shared server and even if you have a dedicated IP address you are most likely still using the server's shared IP address. This can lead to a lot of confusion when diagnosing cURL connections issues and can still be preent on other variations of server i.e. VPS or dedicated but is more unlikely.

My script will allow you to find out what IP address your cURL service is using

Put this on your website that is having the paypal trouble. Put it in a file called curl-ip-test.php

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://www.myremotedomain.com/remote-ip-check.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
curl_close ($ch);
echo "Your Server's IP : ".$contents;
?>

Add this code to the remote website as a php file at www.myremotedomain.com/remote-ip-check.php

<?php
echo $_SERVER["REMOTE_ADDR"];
?>

Basically what these bits of code do, is that the remote script is accessed via the cURL service (from the server you are trying to work out the cURL IP address) and the remote script sees the IP that is being used and gives the cURL request that IP which is then displayed in your browser.

To get the IP just run the file via your web-browser ie www.mydomain.com/called curl-ip-test.php

How do i check if php server allows external curl connections

Create a file like this:

<?php 
phpinfo();
?>

or

<?php
echo "<pre>";
var_dump(curl_version());
?>

or

<?php
$var = echo shell_exec("/usr/bin/curl -L http://www.google.com");
?>

WHMCS Licensing Server Check Script

The following script is used to check to see if your WHMCS install can see the WHMCS.com licensing server. It also can be adapted to further test aspects of a cURL connection and is why I have added it here as a reference.

<?php

    $whmcsurl = "https://www.whmcs.com/index.php";
    $postfields = array("curltest"=>"1");

    $ip = gethostbyname('licensing28.whmcs.com');

    echo "<font style=\"font-size:18px;\">Testing Connection to '$whmcsurl'...<br />URL resolves to $ip<br /><br />";

    if ($ip!="184.94.192.3" && $ip!="208.74.120.227") echo "<font style=\"color:#cc0000;\">Error: The IP whmcs.com is resolving to the wrong IP. Someone on your server is trying to bypass licensing. You'll need your host to investigate and fix.</font><br /><br />";

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $whmcsurl);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $data = curl_exec($ch);

	if (curl_error($ch)) {
		echo "Curl Error: ".curl_error($ch)."<br /><br />";
	} elseif (!$data) {
        echo "Empty Data Response - Please check CURL Installation<br /><br />";
    }

	curl_close($ch);
	
	echo "Connection Response (this should be the HTML from $whmcsurl when working correctly):<br /><br /><textarea rows=\"20\" cols=\"120\">$data</textarea>";

?>

Links

Published in PHP
Saturday, 06 June 2015 18:58

Diagnose PayPal issues in Prestashop

These instructions although geared towards fixing PayPal issues in Prestashop they can be applied to other situations and software platforms where PayPal is used as a payment gateway.

Symptoms

  • PayPal payments failing and showing an error to the client
  • Orders with no products (This might also
  • Back Office not creating orders after successful payment
  • An error is returned but with no information (ie not populated)
  • Nothing is returned from PayPal

Causes and Fixes

  • IP blocked by paypal
    • ip blocked because you are on a shared IP and some other people are doing fraudulent behaviour so the whole IP gets blocked
    • paypal do block IP addresses but usually for 24 hours
    • change IP
    • Contact PayPal MTS and have the ban lifted
  • Network transport issues to paypal
    • try changing IP
    • use a different network
  • Server is still running SSL3
    • disable SSL3
  • SSL certificate might need installing
    • I thing a SSL certificate is required to be installed when using PayPal API, i dont think it is required for IPN
  • Using an old API
    • upgrade the API you are using
  • PayPal is not configured to accept the currency your software platform (ie prestashop) is using
    • configure the currencies correctely
  • sellinux = enabled
    • sirandrewdavis mentions the SELinux=enforcing (security enhanced LINUX) was causing his problem and changing it to SELINUX=disabled fixed his problem
  • Number of connections from a single IP to paypal has been exhausted
    • wait 10 minutes
    • change providers
    • get a dedicated server or VPS
    • get a dedicated IP (this might not work on a shared server because the underlying services of the server will still uses the shared IP)
  • cURL is not enabled 
    • enable cURL as it is required
  • PayPal credentials are not configured correctely
    • re-enter all your details
  • Your shop is not in maintenance mode (if no-one can access your site, the paypal site won't be able to either). (Presta-Changeo Article)
  • There is password protection on your site (if no-one can access your site, the paypal site won't be able to either). (Presta-Changeo Article)
  • Make sure your paypal account is verified, otherwise transactions don't get automatically approved and prestashop will show a payment error (Presta-Changeo Article)
  • The most common Sandbox mode problem with the paypal module is that the orders are not showing up on the shop. (Presta-Changeo Article)
    • The reason for that is the paypal module is currently set up to create orders only if the response it gets from the paypal site is "Completed", however, when running in Sandbox mode, paypal sends a response of "Pending".
      We have read some documentation about changing the sandbox account to send a "Completed" response, but even after trying that, payments still appeared as pending.
  • Your default currency in Prestashop doesn't match your paypal currency. (Presta-Changeo Article)

  • Payment is made using Echeck or other methods that require a longer time to clear. (Presta-Changeo Article)

  • Paypal decides they need to investigate the transaction. (Presta-Changeo Article)

  • Outgoing connections are blocked by your hoster (this is rare)
  • Client inputted data can cause 'Back Office not creating orders after successful payment' (not confirmed)
    1. The customers paypal address not having states, but Prestashop being configured to require a State
    2. The customers paypal profile does not have a phone number, but Prestashop by default requires all addresses to have a phone number
    3. The module has a defective notify URL depending on the PS version
    4. The prestashop product name has characters that Paypal do not accept
    5. The customers address used in Prestashop is not a valid address, and Paypal rejects it
  • You are testing in maintenance mode. You cannot do this, the IPN will be rejected by your store (since the store is 'offline')
    • I need to have the site live while I check this or the payment modules won't be able to receive the post backs... so in effect I'd get a "false positive".
  • Too many IPN request in a certain timeframe causing a temporay ban
  • Faulty or Old code
  • Other modules or software is blocking paypal working
  • PHP version incompatabilities

Other Solutions

  • Clear and Disable all of the Prestashop Caches - code errors might be lurking in the cache
  • Upgrade to the latest version of Prestashop and the PayPal Module
  • Repair the database - See my article New orders not showing on Orders Tab or orders have missing products for synchronizing/repairing the database
  • check log files for errors
  • change IP
  • tracert the network path to PayPal
  • check PHP error log
  • PayPal might be having a server outage - This is rare but has been pointed out that it happened in this old thread

Links

The following are all links i have used to put this article together.

  • HELP Orders Have No Products - OUT - 1.6.0.11 [7 Jan 2015] - PrestaShop - This shows an example of some adding their own debugging code into the paypal module that POSTs the error to Prestashop's inbuilt error logging system via PrestaShopLogger::addLog()
  • Back Office not creating orders after successful payment - PayPal - PrestaShop - Mentions inputting dodgy addresses or wiered characters can prevent orders being created, testing in maintenance mode will fail and the number of IPN requests can cause a temporary ban and code fixes to the prestashop paypal module v1.3.7 / PS 1.6.0.9
  • Most orders do not appear in back office - Configuring & using PrestaShop - PrestaShop - faulty code dues to an upgrade, there were incompatibilites
  • Fixing Paypal Problems in Prestashop - Presto-Changeo - Some common solutions to paypal not working
  • Akensai Ping Online/Offline PHP Script - The base script used to check visability of PayPal servers
  • PayPal Error occurred! - PayPal - PrestaShop - This article identifies an issue with the cookies created by the PayPal module. It tell you how it was found, the method of debuggin and a solution. A further solution in this thread was to update the plugin because PayPal removed the use of SSL3
  • PayPal SSL 3.0 (POODLE) Microsite - This is the offical documentation about from PayPal removing SSL3. As of January 12, 2015 at 12:01 a.m. Pacific Standard Time (PST), PayPal has discontinued support for Secure Socket Layer version 3 (SSL 3.0). This action was taken to help keep customer accounts secure from the POODLE vulnerability. If you have not already done so, you will need to update from SSL 3.0 to the Transport Layer Security (TLS) protocol. The following links provide detailed instructions, including a Merchant Response Guide available in 27 languages, to assist you in making the update from SSL 3.0 to TLS. Your exact settings may vary.
  • PayPal Modification SSL V3 to TLS - PayPal - PrestaShop - A Prestashop forum threa about PayPal disabling SSL3, what it means and what you can do. main 
  • PayPal Error with no error code! - PayPal - PrestaShop  This is the 13 page one, the main theme of the thread is that PayPal blocks IP addresses (with proof) even though Pay Pal denies it.
    • page 1 - Paypal is blocking access and gives IP addresses he ran with the Akensai script to verify a connection to paypal; putting the shop on another server allows paypal to work
    • page 2 - If you look at the addresses I previously put up earlier in this post it seems that it requires access to them. But specifically it tries to contact api-3t.paypal.com
    • page 3 - A simple curl command to https://api-3t.paypal.com/nvp from a shell fails with a 'couldn't connect to host' and all API requests timeout; Responses from PayPal about how they dont block IPs; There is a response about a bad hop on their network dropping packets preventing access to their API endpoints; a response from PayPal about a fault with their servers;
    • page 5 - symanski wrote a script utilising the akensai script to test the PayPal server connectivity which can prove connection issues; there is also a larger script from symanski; a description from symanski about what the script is testing and why
    • page 7 - mentions about how being on a shared server if another account on the server gets the IP banned because of fraud etc.., your PayPal connections will be banned aswell because it is on the same IP
    • page 8 - sirandrewdavis mentions the SELinux=enforcing (security enhanced LINUX) was causing his problem and changing it to SELINUX=disabled fixed his problem
    • page 9 - vinylbodyshop says how his hoster added more IPs in to his cluster to allow for more PayPal Connections and that fixed his issue; symanski quaotes how PayPal MTS say that they dont block access to the APIs and that MTS beleiev that it is a router on the internet that is configured to block access which is owned by AT&T or Sprint; leecook quotes his hosting provider recognises they have an issue with their customers accessing PayPal and are working to fix the issue; symanski is quoting PayPal MTS who admit their is an issue with some clients accessing their API servers pointing towards an AT&T or Sprint router causing the issue.
    • page 10 - leecook who registered a fault with AT&T has reported that they had put a block on the PayPal addresses and it is now removed; leecook says the outcome of this is that either change your IP address or get who ever is blocking it to unblock it
    • page 11 - my cURL test script and why i used it to discover the real server IP address. This will also check if cURL is working
    • page 12 - scorpionsworld has re-written the Akensai script to work via AJAX to prevent a timeout error of 500; hansoft mentions about an incompatability setup on PHP
    • page 13 - d1bizstop points out that PayPal has disabled the use of SSL3 and that this is what caused his issue.
  • blah blah
Published in PayPal
Thursday, 04 June 2015 18:23

Center Homepage Banner

The homepage banner is not centered and requires a bit of coding.

This would involve setting a wrapper to 100% and the banner size inside to fixed with a max-width and auto margins. I would also apply these changes via the overide system.

Example Code:

#homepage-slider {
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 14px;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 1;
  float: left; }
  
@media (max-width: 767px) {
	#homepage-slider {
	width: 100%;
	max-width: 100%;
	padding-top: 20px; }
}
	  
#homepage-slider #homeslider {
	margin: 0 auto;
	padding: 0; }
Published in Prestashop

These should be used in the header.tpl and can be changed to make code run on specific pages.

Run code only on the homepage

1.

{if $page_name == 'index'}
    <div class="home">
{else}
    <div>
{/if}

2.

{if $page_name == 'index'}
<script type="text/javascript">
    var yiw_prettyphoto_style = 'pp_default';
</script>
{else}
{/if}

 

Published in Prestashop

There might come times when you click on a link to a file, for instance a PDF,  and it opens in the browser but instead you want it to download.

If we take PDFs as an example, these will always open in the browser because that is how Adobe Reader is rigged to show the PDF, in the browser. To do otherwise we need to force the download.

Well there are solutions and i will outline them below.

HTML Download Tag

There is a new config option that you can use in a hyperlink

<a href="/path/to/file" download>Click here to download</a>

The code above does work but if you add this into a WYSIWYG it is slightly modified, and that new version also works so is probably a better version.

<a href="/path/to/file" rel="external" download="">Click here to download</a>

Notice that the download option now has parenthesis to hold a variable so it looks like a normal option. The rel="external" seems to be optional and could just be added by the JCE editor as a matter of course.

<a href="/path/to/file" download="">Click here to download</a>

Variant

This could be the same command used better and also allows you change file names which is useful for dynamically create content.

<a href="/files/adlafjlxjewfasd89asd8f.pdf" download="expenses.pdf">Download Your Expense Report</a>

Old HTML Hack

This is a bit of a hack and is listed for completeness. It will cause a windows to open which will trigger the download and hopefully the new window will also dissapear.

<a href="/path/to/file" download target="_blank">Click here to download</a>

PHP Headers

You can alter the Content-Type headers via your PHP session

application/force-download

By default all files are delivered using the content type application/force-download, which forces all browsers to display a “save file as” dialog instead of displaying the file.

.htaccess

This is a useful method because you can globally change download behaviour using the htaccess. The method is similiar to the PHP method where you change the headers sent to the browser but it is done on the server level.

Specify Files or File Types

<FilesMatch "\.(?i:pdf)$">
  ForceType application/octet-stream
  Header set Content-Disposition attachment
</FilesMatch>
  • This will cause all PDFs to download.
  • You can change the file type that the rule affects or add more.
  • With FilesMatch you can target specific files.

Global

AddType application/octet-stream .csv
AddType application/octet-stream .xls
AddType application/octet-stream .doc
AddType application/octet-stream .avi
AddType application/octet-stream .mpg
AddType application/octet-stream .mov
AddType application/octet-stream .pdf
  • Above i have included a few version of this declaration you can put in the .htaccess file.
  • You only need to add the rules that apply to the files you want to force to download.
  • These command are global.

Other

These are other methods i have come across that might be useful to other people.

1. I found a very simple solution for firefox (only works with relative rather than direct href): add type="application/octet-stream"

<a href="/./file.pdf" id='example' type="application/octet-stream">Example</a>

2. Disable PDF plugins, this is more for the end user and is not applied on the server.

Tools> Add-ons> Adobe Acrobat(Adobe pdf plugin for Firefox)> DISABLE

Links

Published in General

Can you help me discover the solution to removing .html from Magento category URL?
How configure magento such that the category url does not have “.html” in the url?

If you want to remove .html from all Magento’s category URL then Follow the below steps

  1. Go to System -> Config -> Catalog -> Search Engine Optimizations tab
  2. Delete “.html” from Category URL Suffix.
  3. Go to System->Index Management
  4. Reindex “Catalog URL Rewrites”
  5. Refresh cache

If you want to remove  .html from all Magento’s product URL then steps will same. Except

2. Delete “.html” from Product URL Suffix.

Original link : http://www.blog.magentosupport.net/2011/07/remove-html-from-category-or-product-url-for-magento-webshop/

Published in Magento

Cause

If you receive this error it is most likely a fault in your template files.

This is most likely caused by you using out of date or faulty code in your template that is overiding the base code. Base code is not usually faulty.

Solution

  • Remove the dodgy files in your template and allow the base code to be used.
  • clear the magento cache

If this does not work, upgrading your shop might be an option.

Links

Published in PayPal

To fix this annoying error I got, when I tried to Re-Index the Data all you have to do is

deleting everything in the /var/locks folder

in your magento folder, of course.

That’s it!

Published in Magento

in magento 1.5+ you cannot see what categories a product is assigned to in the admin. This feature for some reason was removed in magento. This is one of the stupidest things i have come across but kiwigrid has written a an extension to overide this behaviour and force the category tree to expand the category branches that have the product in it. It will not just expand the whole tree. The product category tab takes slightly longer to load whilst the code checks categories and then expands the tree where needed but you dont really notice.

This plugin is easy to install and does not overwrite any core code.

To Install

NB: do this on your demo site first before applying to your live store.

  1. download Kiwigrid AutoExpandProductCategoryTree Extension (on the right side click 'Download Zip')
  2. extract this file
  3. in the extracted files navigate to ../Kiwigrid_AutoExpandProductCategoryTree-master/Kiwigrid_AutoExpandProductCategoryTree-master/src , You should just see the 'app' folder
  4. upload this folder directly to your 'public_html' folder (this should be where you magento is installed), this means the files inside the 'app' folder on your desktop will go into the 'app' folder on the website
  5. if you cache is running you need to empty the following before you will notcie the code workingas expected (you might not need to do both as i wiped both of them in one go)

Useful Links

These are the links i came across whilst doing my research

Published in Magento
Sunday, 22 February 2015 22:23

PHP Easter Eggs - Worked Example

The following is the research i did to show what easter eggs PHP had that could be accessed and then prevented form being access by using .htaccess.


Using htaccess to deny access to PHP Easter Eggs

This is a worked example of Rewrite rules. With special forcus on when you need to involve the = or ? in a url with a query which sometimes is recognised just as a url by some parts of mod_rewrite.

Below is some example urls that you can use to test the htaccess file with. Pay special attention to the = ?. Some of these URL will not be recognised as having queries.

Next to each line in the htacces codes is ome numbers that match to the example URLs. The numbers signify which successfully performed a rewrite.

URL Examples:

1 - http://localhost/turnip.php?tool=PHPE9568F36-D428-11d2-A769-00AA001ACF42  (common exploits hits first)
2 - http://localhost/turnip.php=PHPE9568F36-D428-11d2-A769-00AA001ACF42       (this has no query)
3 - http://localhost/turnip.php?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
4 - http://localhost/=PHPE9568F36-D428-11d2-A769-00AA001ACF42
5 - http://localhost/tmp/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42

htaccess code

## Disallow PHP Easter Eggs (can be used in fingerprinting attacks to determine
## your PHP version). See http://www.0php.com/php_easter_egg.php and
## http://osvdb.org/12184 for more information

These success codes are valid on xammp only

#135#  RewriteCond %{QUERY_STRING} ^(.)*PHPE9568F36-D428-11d2-A769-00AA001ACF42(.)* [NC]
#135#  RewriteCond %{QUERY_STRING} .*PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]
#135#  RewriteCond %{QUERY_STRING} .*=PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]
#135#  RewriteCond %{QUERY_STRING} (?=PHP).* 		[NC]	"# PHP Version Probing"
#135#  RewriteCond %{QUERY_STRING} .*(?=PHP).* [NC]
#35#   RewriteCond %{QUERY_STRING} ^=PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]
#35#   RewriteCond %{QUERY_STRING} (&|^){1,1}=PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]
#2#    RewriteCond %{QUERY_STRING} ^(.)+PHPE9568F36-D428-11d2-A769-00AA001ACF42(.)+ [NC]
#none# RewriteCond %{QUERY_STRING} ^%3F=PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]
#none# RewriteCond %{QUERY_STRING} ^(.*)\?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]

#24#   RewriteCond %{REQUEST_URI} .*(=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} .*(?=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} ^(?=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} (.*)(?=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} (^(.*)?=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} .*(=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} (.*)(=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} (^(.*)=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} (PHP).*[NC]
#none# RewriteCond %{REQUEST_URI} ^(=PHP).*[NC]
#Rewrite rule forced on# RewriteCond %{REQUEST_URI} (?=PHP).* 	[NC]	
#Rewrite rule forced on# RewriteCond %{REQUEST_URI} ^.*(?=PHP).*[NC]

#RewriteRule ^(.*)$ extra/joomla-fingerprinting.php [L]
#RewriteRule ^(.*)$ extra/joomla-fingerprinting.html [L]

These codes are valid on my webserver with Extra Security Including suhosin

#  RewriteCond %{QUERY_STRING} ^(.)*PHPE9568F36-D428-11d2-A769-00AA001ACF42(.)* [NC]
#  RewriteCond %{QUERY_STRING} .*PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]
#  RewriteCond %{QUERY_STRING} .*=PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]
#  RewriteCond %{QUERY_STRING} (?=PHP).* 		[NC]	"# PHP Version Probing"
#  RewriteCond %{QUERY_STRING} .*(?=PHP).* [NC]
#none#  RewriteCond %{QUERY_STRING} ^=PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]
#none#  RewriteCond %{QUERY_STRING} (&|^){1,1}=PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]
#  RewriteCond %{QUERY_STRING} ^(.)+PHPE9568F36-D428-11d2-A769-00AA001ACF42(.)+ [NC]
#  RewriteCond %{QUERY_STRING} ^%3F=PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]
#  RewriteCond %{QUERY_STRING} ^(.*)\?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 [NC]

#24#   RewriteCond %{REQUEST_URI} .*(=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} .*(?=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} ^(?=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} (.*)(?=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} (^(.*)?=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} .*(=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} (.*)(=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} (^(.*)=PHP).*[NC]
#24#   RewriteCond %{REQUEST_URI} (PHP).*[NC]
#none# RewriteCond %{REQUEST_URI} ^(=PHP).*[NC]
#Rewrite rule forced on# RewriteCond %{REQUEST_URI} (?=PHP).* 	[NC]	
#Rewrite rule forced on# RewriteCond %{REQUEST_URI} ^.*(?=PHP).*[NC]

#RewriteRule ^(.*)$ extra/joomla-fingerprinting.php [L]
#RewriteRule ^(.*)$ extra/joomla-fingerprinting.html [L]

Selected code for PHP Easter Egg Protection

These rules work on my Xampp:

Database Version: 5.1.33-community 
Database Collation: utf8_general_ci 
PHP Version: 5.2.9 
Web Server: Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 
Web Server to PHP interface: apache2handler 

the rules

RewriteCond %{QUERY_STRING} (?=PHP).*	[NC]	"# Also PHP Version Probing"
RewriteCond %{REQUEST_URI} .*(=PHP).*	[NC]
RewriteRule ^(.*)$ extra/joomla-fingerprinting.php [L]

The following occurs on my live server with those rules:

Database Version: 5.1.50 
Database Collation: utf8_general_ci 
PHP Version: 5.3.2 
Web Server: Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635

the rules

1. 404
2. 403
3. shows elephant
4. 403
5. shows elephant

 

Published in PHP
Page 46 of 96