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"); ?>
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>"; ?>
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.
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)
The following are all links i have used to put this article together.
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; }
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}
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.
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>
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.
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>
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
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
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
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/
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.
If this does not work, upgrading your shop might be an option.
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!
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.
NB: do this on your demo site first before applying to your live store.
These are the links i came across whilst doing my research
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.
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.
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
## 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]
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