¿Cómo actualizar PHP en Ubuntu 14?

Para hacer más fácil la instalación ejecutar los siguientes comandos

sudo mkdir -p /opt/php-7.3
sudo mkdir /usr/local/src/php7.3-build
cd /usr/local/src/php7.3-build
sudo wget http://de2.php.net/get/php-7.3.11.tar.bz2/from/this/mirror -O php-7.3.11.tar.bz2
sudo tar jxf php-7.3.11.tar.bz2

cd php-7.3.11/

##por si necesitas personalizar la instalación
##sudo ./configure --prefix=/opt/php-7.3 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-pdo-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm#

sudo apt-get install libqt4-dev
sudo apt-get install libjack0
sudo apt-get install libjack-dev
sudo apt-get install libasound2-dev
sudo apt-get install libsndfile1-dev

sudo ./configure
sudo make
sudo make install

##reiniciar Apapache2
sudo service apache2 restart

## sudo aptitude install apache2 apache2-suexec libapache2-mod-fcgid php5-cgi

Error de Tíldes al exportar una tabla HTML a Excel en PHP

Agregar el siguiente código a la cabecera

<?php
$file="exportar.xls";
header("Content-Type: application/vnd.ms-excel charset=iso-8859-1");
header("Content-Disposition: attachment; filename=$file");
?>

No olvidar agregar el siguiente meta

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<table border="1"  cellspacing="0" cellpadding="5">
    <tr>
        <th>Col1</th>
        <th>Col2</th>
    </tr>
    <tr>
        <td>Dato 1</td>
        <td>Dato 2</td>
    </tr>
</table>
</body>
</html>

TCPDF agregar html al header y footer

Filtramos la función del header y footer

class MYPDF extends TCPDF {
        public function Header() {
          $html = get_header_welcome();
          $this->writeHTMLCell($w = 0, $h = 50, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = false, $align = 'C', $autopadding = true);
          $this->setPageMark();
        }
        public function Footer() {
          $html = get_footer_welcome();					
          // get the current page break margin
          $bMargin = $this->getBreakMargin();
          // get current auto-page-break mode
          $auto_page_break = $this->AutoPageBreak;
          // disable auto-page-break
          $this->SetAutoPageBreak(false, 0);
          // write html image
          $this->writeHTMLCell($w = 0, $h = 50, $x = '', $y = '', $html, $border = 0, $ln = 0, $fill = 0, $reseth = false, $align = 'C', $autopadding = false);
          // restore auto-page-break status
          $this->SetAutoPageBreak($auto_page_break, $bMargin);
          // set the starting point for the page content
          $this->setPageMark();					
        }
      }

Invocamos nuestra clase para crear el PDF

$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);