### [筆記] Freebsd 10.1 apache24 / mysql / php56

2016-01-05 未分類

今天發現 pkg install 比 ports make install 快好多好多！我以前花了好多時間在make啊！！！

## APACHE 24

pkg install apache24

sysrc apache24_enable=yes

service apache24 start

Web 根目錄在 /usr/local/www/apache24/data

開啟 http://your_server_ip

應該要看到 It Works !

## MYSQL

pkg install mysql56-server

sysrc mysql_enable=yes

server mysql-server start

mysql_secure_installation (記得改密碼，其他應該ENTER帶過就可以)

## PHP 5.6

pkg install php56 php56-mysql php56-mysqli php56-gd php56-mbstring

cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini

修改 php.ini 找到 DirectoryIndex index.htm 這一行

改成 DirectoryIndex index.php index.html index.htm

再加入底下這幾行

<FilesMatch “.php$”>

SetHandler application/x-httpd-php

</FilesMatch>

<FilesMatch “.phps$”>

SetHandler application/x-httpd-php-source

</FilesMatch>

service apache24 restart

建立一個 test.php

<?php

phpinfo();

?>

這樣應該就完成了

comments powered by Disqus
© 2017 by Lednerb
Bilberry Hugo Theme