How to deploy Laravel Project at CPanel without installing Composer

How to deploy Laravel Project at CPanel without installing Composer

1) Generate – Compile the whole project at local and add one php file to run php scripts at Server
/project_name/public/to_compile_again.php

<?php
system(‘php ../artisan config:clear’);
system(‘php ../artisan config:cache’);
system(‘php ../artisan cache:clear’);
system(‘php ../artisan config:cache’);
?>

2) Upload the whole project to the server at CPanel
3) Create a new subdomain
4) Run the subdomain from the browser
5) Compile the whole project from Browser
eg
http://test.aceinspirationtest.webstarterz.com/to_compile_again.php

5) Run the subdomain / configured domain from browser

Advertisements

Enable PHP error reporting at apache in ubuntu

Change / turn on the error_reporiing setting at /etc/php5/apache2/php.ini
to check the php.ini file path, you can search by phpinfo(); at a test php file and then check the php.ini file path

 

He are new values:
error_reporting = E_ALL & ~E_NOTICE
display_errors = On

 

After changing the setting at php.ini, restart the apache2 server
sudo service apache2 restart

===================================================================

How to Setup Virtual Host with XAMPP and LARAVEL at window OS

Step 1 – Add one virtual host at “httpd-vhosts.conf” at C:/xampp/apache/conf/extra/httpd-vhosts.conf

<VirtualHost *:8085>

DocumentRoot “D:/my_work_project_path/Project_Name/public”

ServerAdmin Project_Name@localhost

ServerName Project_Name

ServerAlias Project_Name

 

<Directory ” D:/my_work_project_path/Project_Name/public “>

AllowOverride All

Order Allow,Deny

Allow from all

Require all granted

</Directory>

</VirtualHost>

 

 

 

Step 2 – Add one host to C:/Windows/System32/drivers/etc/hosts

127.0.0.1             Project_Name

Step 3 – Add one Listen Port to “httpd.conf” at C:\xampp\apache\conf\httpd.conf

Listen 8085

 

Step 4 – Restart Apache server and browse from browser with “http://localhost:8085/”
 

Myanmar Font in TC/PDF export in PHP with laravel

You need to download the font ttf file
Zawgyi-One-20051130.ttf

================
Utility.php
=================
<?php namespace App\Core;

use Validator;
use Auth;
use DB;
use App\Http\Requests;
use App\Session;
use PDF;
use TCPDF_FONTS;

class Utility
{
// Use Pdf Export
public static function exportPDF($html,$pdfTitle = 'exportPDF')
{
PDF::SetTitle($pdfTitle);

require_once(base_path() . '/vendor/tecnickcom/tcpdf/include/tcpdf_fonts.php');
// $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$fontname = TCPDF_FONTS::addTTFfont(app_path() .'/Core/Export/Zawgyi-One-20051130.ttf', 'TrueTypeUnicode', '', 32);

// $font1 = PDF::addTTFfont('/home/waiyan/Downloads/Zawgyi-One-20051130.ttf', 'TrueTypeUnicode', '', 8);
PDF::SetFont($fontname, '', 15, '', false);

// set font
//PDF::SetFont('helvetica', '', 12);
PDF::AddPage();
PDF::writeHTML($html, true, false, false, false, '');

PDF::Output($pdfTitle . '.pdf');
exit();

}

}
===========================================
ServicePdfGenerator.php
===========================================
<?php

namespace App\Core\Export;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Input;
use App\Core\Config\Config;
use App\Core\Utility;
use PDF;

class ServicePdfGenerator implements IPDFGeneratorInterface
{
public function generate($paramObj)
{

ob_end_clean();
ob_start();

$html = <<<EOD

.table_main {
font-size: 10;
}

.table_border {
border: 1;
}

ကခဂ ကခဂ ကခဂ ကခဂ

EOD;

Utility::exportPDF($html,”mm_font_pdf”);
return true;

}
}
==============================================