5.4.1 Mengkonfigurasi Apache, MySQL, dan PHP
1. Buka file httpd.conf yang berada di folder conf pada Apache. Kemudian
tambahkan file yang bercetak tebal berikut di akhir baris file httpd.conf : …….
……. …….
VirtualHost :80 ServerAdmin webmasterdummy-host.example.com
DocumentRoot wwwdocsdummy-host.example.com ServerName dummy-host.example.com
ErrorLog logsdummy-host.example.com-error_log CustomLog logsdummy-host.example.com-access_log
common VirtualHost
ScriptAlias php c:php AddType applicationx-httpd-php .php
For PHP 5 Action applicationx-httpd-php phpphp-cgi.exe
Universitas Sumatera Utara
2. Buka file php.ini di folder C:\WINDOWS dengan menggunakan notepad dan
lakukan beberapa perubahan sebagai berikut:
……… ………
……… ; You should do your best to write your scripts so that they do not
require ; register_globals to be on; Using form variables as globals can easily
lead ; to possible security problems, if the code is not very well thought of.
register_globals = On
……… ………
……… ; Directory in which the loadable extensions modules reside.
extension_dir = c:\PHP\ext
… …
;extension=php_filepro.dll
extension=php_gd2.dll hilangkan tanda ; di depan kalimat
;extension=php_gettext.dll ;extension=php_ifx.dll
;extension=php_imap.dll
Universitas Sumatera Utara
;extension=php_interbase.dll ;extension=php_ldap.dll
;extension=php_mcrypt.dll ;extension=php_mhash.dll
;extension=php_mime_magic.dll ;extension=php_ming.dll
;extension=php_mssql.dll ;extension=php_msql.dll
extension=php_mysql.dll hilangkan tanda ; di depan kalimat
;extension=php_mysqli.dll
3. Mengatur MySQL dengan cara Klik Start Programs MySQL MySQL Server
5.0 MySQL Instance Config Wizard.
4. Pilih Standard Configuration, Klik Next sampai ke Security Options.
5. Konfigurasi Apache 2.0, MySQL 5.0 dan PHP 5.1.2 telah berhasil dan dapat
dipergunakan.
5.4.2 Menjalankan Apache, MySQL, dan PHP
Untuk Menjalankan ketiga software yang digunakan dapat dilakukan dengan cara sebagai berikut:
Universitas Sumatera Utara
1. Untuk menjalankan Apache, Klik Start Programs Apache HTTP Server
5.0.55 Control Apache Server Monitor Apache Servers.
2. Kemudian untuk melihat Apache telah ter-install dengan baik, tuliskan
http:localhost di URL. Jika telah berhasil akan terlihat seperti gambar berikut
ini:
Gambar 5.1 Uji Apache 3.
Uji apakah PHP telah dapat dijalankan dengan cara tuliskan script berikut pada notepad :
?php phpinfo;
? Simpan dengan nama info.php dan letakkan di folder htdocs pada Apache.
Universitas Sumatera Utara
4. Buka internet explorer dan tulis
http:localhostinfo.php di URL address. Jika
berhasil akan tampil sebagai berikut:
Gambar 5.2 Uji PHP 5.
Uji apakah MySQL telah dapat dijalankan dengan cara jalankan command prompt dan ketikan seperti gambar berikut:
Gambar 5.3 Uji MySQL
Universitas Sumatera Utara
6. Maka Apache, MySQL dan PHP telah dijalankan.
5.5 Pengujian Website di Browser