Selasa, 15 Juli 2014

Instalasi Zend Framework

Beberapa saat lalu setelah saya mendengar cerita teman mengenai kelebihan dan kemudahan membuat aplikasi php dengan  Zend framework, akhirnya saya mulai mencoba-coba salah satu framework yang sangat sering dipakai oleh para developer web tersebut.
Kali ini saya ingin membagikan pengalaman beberapa waktu lalu ketika saya memulai dengan Zend Framework yaitu Instalasi dan Konfigurasi framework tersebut. Oke deh gausah banyak basa-basi langsung simak aja… cekidot.
Untuk Webserver saya menggunakan webserver XAMPP versi xampp-win32-1.6.3a, setelah webserver tersebut telah berhasil di install di komputer anda,  berikut tahapannnya:
1. Download Zend Framework Untuk Versi Quick Start. Sekarang anda harus mendownload Framework zend di website resminya yaitu http://framework.zend.com/ , Saya  sarankan anda untuk mendownload versi Quick Startnya yang dapat di download di http://framework.zend.com/demos/ZendFrameworkQuickstart.zip
2. Ekstraklah file yang anda download. File zip yang anda download harus diekstrak terlebih dahulu,  yang hasilnya  akan terdiri dari  struktur seperti berikut:
quickstart
|– application
|   |– Bootstrap.php
|   |– configs
|   |   `– application.ini
|   |– controllers
|   |   |-- ErrorController.php
|   |   |– GuestbookController.php
|   |   `– IndexController.php
|   |– forms
|   |   `– Guestbook.php
|   |– layouts
|   |   `– scripts
|   |        `– layout.phtml
|   |– models
|   |   |– DbTable
|   |   |   `– Guestbook.php
|   |   |– Guestbook.php
|   |   |– GuestbookMapper.php
|   |   `-- user.php
|   `– views
|       |– helpers
|       `– scripts
|           |– error
|           |   `– error.phtml
|           |– guestbook
|           |    `– index.phtml
|           |   `– sign.phtml
|           `– index
|               `– index.phtml
|– data
|   `– db
|       `– guestbook.db
|       `– guestbook-dev.db
|       `– guestbook-testing.db
|– library
|– public
|   |– .htaccess
|   `– index.php
|– scripts
|   |– data.sqlite.sql
|   |– load.sqlite.php
|   `– schema.sqlite.sql
|– tests
|   |– application
|   |   |– controllers
|   |   |   `– GuestbookControllerTest.php
|   |   `– bootstrap.php
|   |– library
|   |   `– bootstrap.php
|   `– phpunit.xml
|– .vimproject
`– .zfproject.xml

3. Copy File Hasil Ekstrak ke Folder htdocs. Saya mengcopy file yang tadi di ekstrak ke dalam folder htdocs, seperti path berikut :  “C:\xampp\htdocs\quickstart”, jadi semua file ada didalam folder quickstart.
4. Download Zend Framework 1.10.2 Minimal. Saya mendownload zend framework versi minimal ini untuk mengambil file-file library yang dibutuhkan untuk membangun program di framework tersebut. Anda dapat mendownloadnya di http://framework.zend.com/releases/ZendFramework-1.10.2/ZendFramework-1.10.2-minimal.zip, setelah di download lakukan ekstraksi, lalu copy lah folder zend yang ada di folder library hasil ekstrakan tersebut ke folder library dimana anda menaruh zend framework di htdocs dalam hal ini folder library tujuan berada di path c:\xampp\htdocs\quickstart\library nanti setelah dicopy akan menjadi c:\xampp\htdocs\quickstart\library\zend.
5. Tambahkan path untuk library zend pada  include_path. Untuk menambahkan include_path anda harus membuka file php.ini pada webserver anda, lokasi file php.ini dapat anda check di php info caranya buka browser anda lalu ketik http://localhost/,  disini saya memakai XAMPP sebagai webserver. Lokasi file php.ini dapat dilihat seperti gambar berikut:
Lokasi File php.ini
Seperti pada gambar diatas, lokasi file php.ini berada di path c:\xampp\apache\bin\php.ini, buka file tersebut lalu cari bagian include_path = “.;C:\xampp\php\pear\” lalu tambahkan dengan lokasi path dari library zend yang telah anda copy pada langkah ke 3. hasil penambahan path akan menjadi : include_path = “.;C:\xampp\php\pear;C:\xampp\htdocs\quickstart\library\zend” Setelah itu restart apache anda.

6. Membuat htaccess dan index.php (bootstraping) Pada tahap ini kita akan membuat file index.php untuk bisa menampilkan project pertama kita, ya ga susah-susah kita buat Hello World aja,,,, Kata-kata ini emang pas kalo kita baru mempelajari bahasa pemrograman baru. ckckkckc. Okey jadi becanda aja ni…, selanjutnya buat file baru dan beri nama index.php yang berisi source code berikut:
<?php
error_reporting(E_ALL|E_STRICT);
date_default_timezone_set('Europe/London');
set_include_path('.' . PATH_SEPARATOR . 'library'
 . PATH_SEPARATOR . './application/models/'
 . PATH_SEPARATOR . get_include_path());
include "Zend/Loader.php";
Zend_Loader::loadClass('Zend_Controller_Front');

// setup controller
$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->setControllerDirectory('./application/controllers');
// run!
$frontController->dispatch();
?>

Dan selanjutnya buat file .htaccess   yang fungsinya mencegah user
masuk ke dalam folder kita dengan mengetikan nama folder di dalam
url. Sehingga, setiap user akan kita alihkan ke halaman index root
saja. berikut source codenya:
RewriteEngine on
RewriteRule .* index.php

Simpan kedua file tersebut di folder quickstart pada path C:\xampp\htdocs\quickstart\. Langkah selanjutnya kita akan menampilkan tulisan hello world di browser anda, caranya buka file inde.phtml yang berada di path C:\xampp\htdocs\quickstart\application\view\script\index\index.phtml lalu hapus semua isi file tersebut, dan isikan tulisan Hello world, lalu save. lalu buka browser anda ketikan http://localhost/quickstart/ maka browser akan menampilkan tulisan hello world… mudah kan. Sampai sini framwework zend anda telah berhasil di instal. 

Sumber = 
 
Read More

Senin, 14 Juli 2014

Prolink PCM 100 di Windows 8.1 x64

Windows 8 has been officially launched and the most common problems that are encountered when you use a new OS are related to driver compatibility issues. Some drivers do not support Windows 8 and when you force to install the driver, Windows 8 will reject it. Different with previous versions of windows, the regulation of the drivers on Windows 8 is very tight, and you need more effort when you install a driver that does not officially support Windows 8. This time I will share my experience installing driver from a Prolink PCM100 USB Modem on Windows 8.

A few weeks ago I tried to install a driver from Prolink PCM100 on Windows 8 RTM x64. I used the “compatibility mode” on the setup.exe file and install it normally. After that I checked in the Device Manager and found the device status was “unknown device” then I tried to update the driver manually (still in the device manager) using the “.inf” file and the Windows 8 RTM accepted the “.inf” file, though the file is designed only for Windows 7.
Yesterday I installed the latest version of Windows 8, the Windows 8 Pro x64. Then I tried to install driver from USB Modem PCM100 on that Windows by using the “compatibility mode” on the setup.exe file and the installation seemed to run normally, but at the end of the installation process it apparently came out an error message “Fail to install modem”.
fail to install modem
I tried to check the device manager, there was a device with status “unknown device” and then I tried to update the driver manually using the file “.inf” as I did before, and the error message “Driver is not intended for this platform” appeared.
driver is not intended for this platform
Then I tried to edit the “.inf” file using notepad. The entire “NTia64” was replaced by “NTia64.6.2” and all “NTamd64” was replaced by “NTamd64.6.2” then I tried to update the driver with the “.inf” file which has been modified and the error message “The hash for the file is not present in the specific catalog file. The file is likely corrupt or the victim of tampering.” appears.
[Version]
Signature="$WINDOWS NT$"
Class=Modem
Provider=%ZTEMT%
CLASSGUID={4D36E96D-E325-11CE-BFC1-08002BE10318}
DriverVer=05/13/2010,2.0.5.6
Catalogfile = ztemtusbser.cat

[Manufacturer]
%ZTEMT%=Models, NTia64, NTamd64

[ControlFlags]
ExcludeFromSelect = *

[SourceDisksNames]
1000 = %ZTEMTSrcDisk%,"",,

[SourceDisksFiles]
CT_U_USBSER.sys = 1000

[Models]
%ZTEFFFF% = ModemRevA, USB\VID_19D2&PID_FFFF&MI_00
%ZTEFFFE% = Modem2, USB\VID_19D2&PID_FFFE&MI_00
%ZTEFFFD% = Modem2, USB\VID_19D2&PID_FFFD&MI_00
%ZTEFFFC% = Modem2, USB\VID_19D2&PID_FFFC&MI_00

%ZTEFFFB% = Modem2, USB\VID_19D2&PID_FFFB&MI_00
%ZTEFFFA% = Modem2, USB\VID_19D2&PID_FFFA&MI_00
%ZTEFFF9% = Modem2, USB\VID_19D2&PID_FFF9&MI_00
%ZTEFFF8% = Modem2, USB\VID_19D2&PID_FFF8&MI_00
%ZTEFFF7% = ModemRevA, USB\VID_19D2&PID_FFF7&MI_00
%ZTEFFF6% = ModemRevA, USB\VID_19D2&PID_FFF6&MI_01 ; MI_00 is Used for USB Disk
%ZTEFFF1% = ModemRevA, USB\VID_19D2&PID_FFF1&MI_00
%ZTEFFF0% = ModemRevA, USB\VID_19D2&PID_FFF0&MI_04
%ZTEFFEF% = Modem2, USB\VID_19D2&PID_FFEF&MI_00
%ZTEFFEE% = Modem2, USB\VID_19D2&PID_FFEE&MI_00
%ZTEFFEC% = Modem2, USB\VID_19D2&PID_FFEC&MI_03
%ZTEFFEA% = Modem2, USB\VID_19D2&PID_FFEA&MI_01
%ZTEFFE9% = Modem2, USB\VID_19D2&PID_FFE9&MI_00
%ZTEFFE8% = Modem2, USB\VID_19D2&PID_FFE8&MI_00
%ZTEFFE7% = Modem2, USB\VID_19D2&PID_FFE7&MI_00
%ZTEFFE4% = Modem2, USB\VID_19D2&PID_FFE4&MI_00

[Models.NTamd64]
%ZTEFFFF% = ModemRevA, USB\VID_19D2&PID_FFFF&MI_00
%ZTEFFFE% = Modem2, USB\VID_19D2&PID_FFFE&MI_00
%ZTEFFFD% = Modem2, USB\VID_19D2&PID_FFFD&MI_00
%ZTEFFFC% = Modem2, USB\VID_19D2&PID_FFFC&MI_00

%ZTEFFFB% = Modem2, USB\VID_19D2&PID_FFFB&MI_00
%ZTEFFFA% = Modem2, USB\VID_19D2&PID_FFFA&MI_00
%ZTEFFF9% = Modem2, USB\VID_19D2&PID_FFF9&MI_00
%ZTEFFF8% = Modem2, USB\VID_19D2&PID_FFF8&MI_00
%ZTEFFF7% = ModemRevA, USB\VID_19D2&PID_FFF7&MI_00
%ZTEFFF6% = ModemRevA, USB\VID_19D2&PID_FFF6&MI_01 ; MI_00 is Used for USB Disk
%ZTEFFF1% = ModemRevA, USB\VID_19D2&PID_FFF1&MI_00
%ZTEFFF0% = ModemRevA, USB\VID_19D2&PID_FFF0&MI_04
%ZTEFFEF% = Modem2, USB\VID_19D2&PID_FFEF&MI_00
%ZTEFFEE% = Modem2, USB\VID_19D2&PID_FFEE&MI_00
%ZTEFFEC% = Modem2, USB\VID_19D2&PID_FFEC&MI_03
%ZTEFFEA% = Modem2, USB\VID_19D2&PID_FFEA&MI_01
%ZTEFFE9% = Modem2, USB\VID_19D2&PID_FFE9&MI_00
%ZTEFFE8% = Modem2, USB\VID_19D2&PID_FFE8&MI_00
%ZTEFFE7% = Modem2, USB\VID_19D2&PID_FFE7&MI_00
%ZTEFFE4% = Modem2, USB\VID_19D2&PID_FFE4&MI_00

[Models.NTia64]
%ZTEFFFF% = ModemRevA, USB\VID_19D2&PID_FFFF&MI_00
%ZTEFFFE% = Modem2, USB\VID_19D2&PID_FFFE&MI_00
%ZTEFFFD% = Modem2, USB\VID_19D2&PID_FFFD&MI_00
%ZTEFFFC% = Modem2, USB\VID_19D2&PID_FFFC&MI_00

%ZTEFFFB% = Modem2, USB\VID_19D2&PID_FFFB&MI_00
%ZTEFFFA% = Modem2, USB\VID_19D2&PID_FFFA&MI_00
%ZTEFFF9% = Modem2, USB\VID_19D2&PID_FFF9&MI_00
%ZTEFFF8% = Modem2, USB\VID_19D2&PID_FFF8&MI_00
%ZTEFFF7% = ModemRevA, USB\VID_19D2&PID_FFF7&MI_00
%ZTEFFF6% = ModemRevA, USB\VID_19D2&PID_FFF6&MI_01 ; MI_00 is Used for USB Disk
%ZTEFFF1% = ModemRevA, USB\VID_19D2&PID_FFF1&MI_00
%ZTEFFF0% = ModemRevA, USB\VID_19D2&PID_FFF0&MI_04
%ZTEFFEF% = Modem2, USB\VID_19D2&PID_FFEF&MI_00
%ZTEFFEE% = Modem2, USB\VID_19D2&PID_FFEE&MI_00
%ZTEFFEC% = Modem2, USB\VID_19D2&PID_FFEC&MI_03
%ZTEFFEA% = Modem2, USB\VID_19D2&PID_FFEA&MI_01
%ZTEFFE9% = Modem2, USB\VID_19D2&PID_FFE9&MI_00
%ZTEFFE8% = Modem2, USB\VID_19D2&PID_FFE8&MI_00
%ZTEFFE7% = Modem2, USB\VID_19D2&PID_FFE7&MI_00
%ZTEFFE4% = Modem2, USB\VID_19D2&PID_FFE4&MI_00
the hash for file is not present
Apparently the “hash” of “.inf” file was changed because I have edited it and was not in accordance with the Security Catalog file “.cat”. Then I tried to edit the “.inf” file again, this time I tried to give a sign “;” on the line Catalogfile so that the statement is no longer used because it is considered as a comment, and then I went back into device manager to try to update the driver again, and I encountered this error “The third-party INF does not contain digital signature information.”
[Version]
Signature="$WINDOWS NT$"
Class=Modem
Provider=%ZTEMT%
CLASSGUID={4D36E96D-E325-11CE-BFC1-08002BE10318}
DriverVer=05/13/2010,2.0.5.6
;Catalogfile = ztemtusbser.cat
The third-party INF does not contain digital signature information
In Windows 7, if you install a driver that does not have digital signature information, then Windows 7 will give us two options: “Do not install this driver software / Install this driver any way “. However, in windows 8 it did not appear that options. I had to restart the computer and press F8 on the dual boot menu or during POST. It would appear the “Startup settings” menu and then I selected the seventh option “Disable driver signature enforcement”.
Windows 8 Start Up Settings 

install this driver software anyway
When I tried to update the driver from device manager again, eventually a small window appeared with the two choices: “Do not install this driver software / Install this driver software any way”, and I certainly chose “Install this driver software any way” and successfully, the driver was installed perfectly. I hope my experience is useful for those of you who have driver compatibility issues in Windows 8/8.1.
Read More