Mengkonfigurasi Apache, MySQL, dan PHP Menjalankan Apache, MySQL, dan PHP

5.4.1 Mengkonfigurasi Apache, MySQL, dan PHP

1. Buka file httpd.conf yang berada di folderconf 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 2. Buka filephp.ini di folderC:\WINDOWS dengan menggunakan notepad dan lakukan beberapa perubahan sebagai berikut: Universitas Sumatera Utara ……… ……… ……… ; 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 ;extension=php_interbase.dll ;extension=php_ldap.dll Universitas Sumatera Utara ;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-installdengan 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.phpdan letakkan di folderhtdocs 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 promptdan ketikan seperti gambar berikut: Universitas Sumatera Utara Gambar 5.3 Uji MySQL Maka Apache, MySQL dan PHP telah dijalankan.

5.5 Menjalankan Xampp