FreeBSD:Apache:修订间差异

来自WHY42
imported>Riguz
(创建页面,内容为“<source lang="bash"> pkg install apache24 #/etc/rc.conf apache24_enable="yes" </source> Category:Linux/Unix”)
 
无编辑摘要
 
(未显示1个用户的2个中间版本)
第2行: 第2行:
pkg install apache24
pkg install apache24


#/etc/rc.conf
sysrc apache24_enable="yes"
apache24_enable="yes"
# /etc/rc.conf
# apache24_enable="yes"
 
service apache24 start
# /usr/local/www/apache24/data/
</source>
安装 php:
<source lang="bash">
pkg install php72 mod_php72 php72-ctype php72-mbstring php72-json php72-iconv php72-fileinfo php72-xml php72-session php72-dom php72-hash php72-gd php72-xmlreader php72-xmlwriter php72-openssl
</source>
</source>
在/usr/local/etc/apache24/modules.d中新建配置文件:010_mod_php.conf,注意命名。
<pre>
# Files are automatically included if the name
# begins with a three digit number followed by '_'
# and ending in '.conf' e.g. '080_mod_php.conf'
</pre>


<pre>
<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>
</pre>


还需要在 httpd.conf中打开 mod_rewrite.
[[Category:Linux/Unix]]
[[Category:Linux/Unix]]

2018年9月6日 (四) 07:54的最新版本

pkg install apache24

sysrc apache24_enable="yes"
# /etc/rc.conf
# apache24_enable="yes"

service apache24 start
# /usr/local/www/apache24/data/

安装 php:

pkg install php72 mod_php72 php72-ctype php72-mbstring php72-json php72-iconv php72-fileinfo php72-xml php72-session php72-dom php72-hash php72-gd php72-xmlreader php72-xmlwriter php72-openssl

在/usr/local/etc/apache24/modules.d中新建配置文件:010_mod_php.conf,注意命名。

# Files are automatically included if the name
# begins with a three digit number followed by '_'
# and ending in '.conf' e.g. '080_mod_php.conf'
<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>

还需要在 httpd.conf中打开 mod_rewrite.