5.4 Instalasi
Apache, PHP dan MySQL
Dalam menginstalasi Apache, PHP dan MySQL dilakukan secara satu per satu. Adapun softwarenya dapat diperoleh dari situs
http:www.apache.org untuk Apache,
http:www.php.net untuk PHP dan
http:www.mysql.com untuk MySQL. Tahap
instalasinya dimulai dengan menginstalasi Apache, kemudian disusul dengan menginstalasi PHP dan MySQL. Setelah instalasi selesai dilanjutkan dengan
melakukan pengaturan konfigurasi yang diberikan setelah instalasi selesai.
5.4.1 Mengkonfigurasi Apache, PHP dan MySQL
1. Buka file httpd.conf pada apache dengan menggunakan Notepad untuk
melakukan konfigurasi pada Apache, kemudian tambahkan kata yang bercetak tebal.
………………………………………… AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
If the AddEncoding directives above are commented-out, then you probably should define those extensions to indicate media types:
AddType applicationx-compress .Z AddType applicationx-gzip .gz .tgzs
ScriptAlias php C:php
Resti Aulia : Perancangan Sistem Informasi Berbasis Web Pada Sekolah Tinggi Agama Islam Jamiyah Mahmudiyah Menggunakan PHP, 2008 USU Repository © 2008
AddType applicationx-httpd-php .php .php Action applicationx-httpd-php phpphp-cgi.exe
2. Buka file php.ini pada php dengan menggunakan Notepad dan lakukan beberapa
perubahan seperti 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
…………………………………… ; Maximum size of POST data that PHP will accept.
post_max_size = 8M ; Magic quotes
; ; Magic quotes for incoming GETPOSTCookie data.
magic_quotes_gpc = On
……………………………………… ; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root ; if you are running php as a CGI under any web server other than IIS
; see documentation for security issues. The alternate is to use the ; cgi.force_redirect configuration below
doc_root =”c:\apache\apache2\htdocs”
; The directory under which PHP opens the script using ~username used only
Resti Aulia : Perancangan Sistem Informasi Berbasis Web Pada Sekolah Tinggi Agama Islam Jamiyah Mahmudiyah Menggunakan PHP, 2008 USU Repository © 2008
; if nonempty.
user_dir =”c:\php\ext”
; 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
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
……………………………………….. ; Define the User-Agent string
; user_agent=PHP ; Default timeout for socket based streams seconds
default_socket_timeout = 60
Resti Aulia : Perancangan Sistem Informasi Berbasis Web Pada Sekolah Tinggi Agama Islam Jamiyah Mahmudiyah Menggunakan PHP, 2008 USU Repository © 2008
upload_tmp_dir=C:\php\Temp\upload session.save_path=C:\php\Temp\session
3. Simpan perubahan konfigurasi pada file httpd.conf dan php.ini, kemudian lakukan
restart pada Apache, dan restart juga komputer.
5.4.2 Menjalankan Apache, PHP dan MySQL