Loading

email for cpanel test

  1. Return-Path: <topspa@scar.made2grow.com>
  2. Delivered-To: geral@topspa.pt
  3. Received: from scar.made2grow.com
  4.     by scar.made2grow.com with LMTP
  5.     id kGVlBHtQ5V2GKQAAd3ndwQ

versão de PHP por pasta

  1. #Alterar para versão PHP 5.5
  2. <FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
  3. SetHandler application/x-httpd-alt-php55___lsphp
  4. </FilesMatch>

Verificar Versão TLS/SSL

  1. <?php
  2.  
  3. $ch = curl_init('https://www.howsmyssl.com/a/check');
  4. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  5. $data = curl_exec($ch);

HSTS Header

  1. <IfModule mod_headers.c>
  2. Header always set Strict-Transport-Security "max-age=31536000; preload; includeSubDomains" env=HTTPS
  3. </IfModule>

PHP version per directori

  1. <FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
  2. SetHandler application/x-httpd-alt-php71___lsphp
  3. </FilesMatch>
  4.  
  5. # Para alterar a versão do PHP deverá na segunda linha alterar de php71 para a versão desejada.

alterar versão do PHP

  1. <FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
  2. SetHandler application/x-httpd-alt-php71___lsphp
  3. </FilesMatch>

alterar versão do PHP

  1. <FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
  2. SetHandler application/x-httpd-ea-php71-lsphp
  3. </FilesMatch>

redirect http to https

  1. RewriteCond %{SERVER_PORT} ^80$
  2. RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

Leverage Browser Caching

  1. <IfModule mod_expires.c>
  2.   ExpiresActive On
  3.  
  4.   # Images
  5.   ExpiresByType image/jpeg "access plus 1 year"

call asp script

  1. Call RunIt()
  2. Sub RunIt()
  3. Dim RequestObj
  4. Dim URL
  5. Set RequestObj = CreateObject("Microsoft.XMLHTTP")

.htaccess Softaculous WP

  1. # Ficheiro .htaccess Softaculous WP Sign-on
  2. # BEGIN WordPress
  3. <IfModule mod_rewrite.c>
  4. RewriteEngine On
  5. RewriteBase /

Redirect http to https PH

  1. <?php
  2. if(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"){
  3.     $redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
  4.     header('HTTP/1.1 301 Moved Permanently');
  5.     header('Location: ' . $redirect);

Teste E-mail por mail()

  1. <!DOCTYPE html>
  2. <html lang="en">
  3.   <head>
  4.     <meta charset="utf-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

Exemplo de pipe em PHP

  1. #!/usr/bin/php -q
  2. <?php
  3. $rawData = file_get_contents("php://stdin");
  4. file_put_contents("teste.txt", $rawData);
  5. ?>

Teste de Ligação PHP

  1. <?php
  2. error_reporting(E_ALL);ini_set('display_errors', 1);
  3.  
  4. $servidor = "endereco.do.servidor";
  5. $porta = "1234";