Your Location is: Home > Php

Server document root and folder in different machines

From: Albania View: 3405 YvetteLee 


I am using tDPDF to use unicode font. The problem is that i am creating my web page using xampp, testing on Raspberry Pi LAMP server and uploading on my server. All of them have different server document root address which it is causing an error on a unicode file(php). It has the following line

Xampp File


I must change it to something that it will work to all my address, like


I tested the following but missing the folder in each machine(app-final, html, www, etc...)

$ttffile=$_SERVER["DOCUMENT_ROOT"] . "/fpdf/font/unifont/Calibri.ttf";

My links so far:

C:\xampp\htdocs\app-final\fpdf/font/unifont/Calibri.ttf   html/     fpdf/font/unifont/Calibri.ttf    www/      fpdf/font/unifont/Calibri.ttf

Best answer

It was so simple

$ttffile= __DIR__ . "/Calibri.ttf";