Archive

Posts Tagged ‘php’

WHMCS and Thai language (UTF-8) Patch

August 14th, 2008 Scalopus+ No comments

Build from WHMCS — The Hosting Billing Software does not take full support for other languages except English. You can see that the PDF invoice show incorrect characters. For Thai language who use UTF-8 can use the following patch

whmcs-utf8-thai-patch.zip

Tested with following system

  • WHMCS 3.6.2 (Default System Encode: UTF-8)
  • Thai language translation file (UTF-8)
  • UTF-8 Database (Thai language in database cannot reading)
  • TCPDF 4.0.018
  • Tahoma fonts (New Compile)

Tags: , , ,

Create Thai PDF file

May 15th, 2008 Scalopus+ No comments

วิธีสร้าง PDF File ภาษาไทย

  1. http://www.thai-programmer.com/?DPage=25
  2. http://www.ros.co.nz/pdf/
  3. http://www.morelightmorelight.com/projects/walletpdf/
  4. http://www.fpdf.org/ | http://www.fpdf.org/phorum/read.php?f=1&i=5090&t=4996#5090
  5. http://www.setasign.de/products/pdf-php-solutions/fpdi/

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

แหล่งข้อมูล: ไม่ทราบแหล่งที่มา (ใครเป็นเจ้าของช่วยบอกด้วยฮะ)

ให้ดาวน์โหลดตัวที่สร้าง font ก่อน จากที่นี่

http://www.fpdf.org/fr/dl.php?id=22
ให้ดาวน์โหลด cp874.map กับ iso-8859-11.map

หลังจากนั้นจะได้ไฟล์ exe มา 1 ตัว ให้เข้า dos รันมันขึ้นมา โดย
ใส่ parameter ตามนี้ อย่าไปคลิกที่ตัวมันนะ เพราะต้องใส่ parameter

ttf2pt1 -b -L cp874.map angsa.ttf angsa

ตรง angsa.ttf angsa ก็แล้วแต่ font ที่ท่านต้องการจะสร้างว่าต้องการใช้ font อะไรบ้าง

angsa.ttf เป็น font ใน windows เราอ่ะครับ ไป copy มาก็ได้ จะได้ไม่ต้องใส่ path
angsa คือชื่อที่เราจะตั้ง

หลังจากนั้นจะได้ ไฟล์มา 2 ตัว คือ
angsa.afm กับ angsa.pfb

หลังจากนั้น copy ทั้งสองตัวไปที่ /font/makefont
แล้วเขียน ไฟล์ php ตัวนึง ชื่ออะไรก็ได้ เพื่อรัน makefont.php ดังนี้

MakeFont(‘angsa.pfb’,'angsa.afm’,'cp874′);

จะได้ file 2ตัวออกมา angsa.php and angsa.z

copy ไปวางที่ /font
ใช้คำสั่ง addfont

$pdf->AddFont(‘angsa’,”,’angsa.php’);

Tags: ,

DirectAdmin: PHP enable IMAP,POP3 with SSL

May 3rd, 2008 Scalopus+ No comments

Current version of DirectAdmin (a hosting control panel software) didn’t build a php compiler with IMAP features, if you would like to compile custom PHP compiler to install web application such as eTicket, osTicket, SugarCRM and so on… you can build by DirectAdmin script as below

  1. For Apache 1 with no suPHP, configuration file at /usr/local/directadmin/custombuild/configure/ap1
  2. For Apache 2 with no suPHP, configuration file at /usr/local/directadmin/custombuild/configure/ap2
  3. For Apache with suPHP, configuration file at /usr/local/directadmin/custombuild/configure/suphp

Edit configuration up on your PHP compiler version, for me use configure.php5. Insert into the last line

"–with-imap-ssl" \
"–with-imap"

Save and quit.

Now, install some library may needs to compile new PHP compiler. For Ubuntu use below command

# sudo apt-get install libc-client-dev libc6-dev ca-certificates

Now, build new PHP compiler

# cd /usr/local/directadmin/custombuild/
# ./build php d

Try <?php phpinfo(); ?> on your web server, you should see imap extension.

Tags: , , ,

SMTP Server – 501 5.5.4 Invalid Address

April 24th, 2008 Scalopus+ No comments

When I use this php command over VPN connection, It’ll response with error message `501 5.5.4 Invalid Address`

  • mail($to,$subject,$message,"From: PHP Client <no-reply@example.com>");

Change to

  • mail($to,$subject,$message,"From: no-reply@example.com");

I really don’t know the root cause of that. Because I can use php command #1 normally over LAN connection. But when I working outside and use VPN connection back to my home, it will show error message. It might be come from Windows 2003 SMTP Server, or might be come from internal PHP script. if you have a same problem, try the same things. Hope this will help.

Tags: ,

Secured for spam by MLW and Associates, LLP's Super CAPTCHASecured by Super-CAPTCHA © 2009-2010 MLW & Associates, LLP. All rights reserved.