Jesin's Blog

Welcome to the Portal of Technology

  • Facebook
  • GitHub
  • Google+
  • RSS
  • Twitter
  • Home
  • Categories
    • Domains
    • Linux
    • Networking
    • PHP
    • Virtualization
    • Web Design
    • Web Servers
    • Windows
  • WordPress Plugins
    • Custom Error Pages
    • HTTP Digest Authentication
    • Mailgun Email Validator
  • Toolbox
    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool
  • About Me
  • Contact Me
  • Sitemap
Home ›
php.ini

How to use PHP to minify HTML output

February 10, 2013 PHP Jesin A 5 Comments

php category thumbnail

Couple of years ago I wrote an article about two PHP configuration options auto_prepend_file and auto_append_file recently while browsing about PHP minification I got an idea on how to apply this PHP minify code to each and every script executed on the server so that all HTML output from that server are auto minified. This method requires creating a PHP file containing the code to strip whitespaces and newlines before and after the HTML tags and including this file with every PHP script executed on the server using the auto_prepend_file configuration option. For this you need to have access to the php.ini file. This method will work fine even if you are using shared hosting with custom php.ini support.Continue Reading…

Tags: php, php.ini

How to use MSMTP with Gmail, Yahoo and PHP Mail

October 24, 2011 Linux Jesin A 12 Comments

linux category thumbnail

This is a three in one tutorial which combines how to use MSMTP to send mails via Gmail and Yahoo servers and how to use MSMTP with PHP Mail() function instead of the default sendmail.

Installing msmtp

To install msmtp on Red Hat/CentOS/Fedora type of distributions

yum install msmtp

To install msmtp on Debian/Ubuntu type of distributions

apt-get install msmtp

Configuring msmtp with Gmail and Yahoo

Create or edit the msmtp configuration file in the user’s home directory. I use VI editor to achieve this

vi ~/.msmtprc

Add the following lines to the file, it configures msmtp for both Gmail and Yahoo

account yahoo
tls on
tls_starttls off
auth on
host smtp.mail.yahoo.com
user user1
from user1@yahoo.com
password ******
account gmail
tls on
auth on
host smtp.gmail.com
port 587
user user1@gmail.com
from user1@gmail.com
password ******

Since the file contains sensitive data like passwords you should assign secure permissions

chmod 600 ~/.msmtprc

Continue Reading…

Tags: linux, php, php.ini

PHP auto_prepend_file and auto_append_file

August 7, 2011 PHP Jesin A 12 Comments

php category thumbnail

This article will show you how to use the PHP configuration directives auto_prepend_file and auto_append_file. These two PHP directives perform the same function as require() but they do it globally on all PHP scripts. The PHP auto_prepend_file and auto_append_file directives can only be used in php.ini files. They do NOT work when used in .htaccess file, I’m mentioning this so that you don’t waste precious time editing your .htaccess file. If you want to set these configuration directives on directory basis you can use them in your custom php.ini file.Continue Reading…

Tags: php.ini

Get a wealth of information delivered to your inbox. Subscribe and never miss a single article.

  • Tutorials and howtos
  • Code, scripts and commands
  • Online Tools

* No spam, unsubscribe anytime

Hire Me

  • SSL installation and hardening (A+ on Qualys SSL test)
  • Apache & Nginx configuration
  • Email deliverability improvement (10/10 on Mail Tester & MailGenius)
  • WordPress customization, optimization and migration
  • and much more…

    Tools

    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool

    Nav

    • Home
    • About Me
    • Contact Me
    • Privacy Policy
    • Sitemap
    Vultr SSD VPS

    Creative Commons License
    Jesin's Blog by Jesin A is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
    Based on a work at websistent.com.