Apache web server one of the most widely used. Apache can also be installed on freebsd. following way to install apache, PHP5, mysql the most easy to use ports.
1. Install Apache:
to start just type
to enable apache on boot add
apache22_enable=”YES” following file /etc/rc.conf
check apache on your browser type localhost
2. Install PHP 5
make sure to build Apache module is
checked
add these option on file /usr/local/etc/apache22/httpd.conf
1 | AddType application / x - httpd - php .php |
2 | AddType application / x - httpd - php - source .phps |
Add Index.php to load auto index
2 | DirectoryIndex index.html index.php |
create file php.ini by copy php.ini-dist
and then
restart apache
create file php on /usr/local/www/apache22/data/
save as test.php
now test on your browser http://127.0.0.1/test.php
Install Mysql 5
create database
change owner and group as mysql
run mysql daemon
1 | / usr / local / bin / mysqld_safe –user = mysql & |
change mysql password
1 | / usr / local / bin / mysqladmin - u root password newpass |
to
automatic msyql enable when boot add /etc/rc.conf:
Install php5-mysql module
1 | cd / usr / ports / databases / php5 - mysql |
create file php to check mysql
02 | $test = mysql_connect( "localhost" , "mysql" ,""); |
save as test-db.php on /usr/local/www/apache22/data/ and go to your browser http://localhost/test-db.php
Tidak ada komentar:
Posting Komentar