
首先我们需要下载PHP及其相关的一些扩展。
opkg update
opkg install php5 php5-cgi php5-mod-mcrypt php5-mod-curl php5-mod-hash php5-mod-json
配置PHP《参考文献:http://houdunwang.com/lesson.html》
编辑php.ini文件
vi /etc/php.ini
其中将
extension = ctype.so
extension = curl.so
extension = hash.so
extension = json.so
三个前面的去掉,用以启用扩展
并将date.timezone =修改为date.timezone = Asia/Shanghai,并将doc_root="/www"修改为doc_root="/www/root"。
如果你没有设置过系统时区的话还需要设置系统时区。打开LUCI界面,进入系统 - 系统属性 - 基本设置中将时区改为Asia/Shanghai。
最后你需要安装一个时区信息软件包,否则系统无法识别时区。
opkg install zoneinfo-asia
uhttpd配置端口转发
接着需要配置端口转发。由于默认的是LUCI占用80端口,但我比较喜欢80端口放网站,所以我将LUCI挪到了8080端口,而PHP则使用80端口。
vi /etc/config/uhttpd
将第5行的0.0.0.0:80修改为0.0.0.0:8080,
option rfc1918_filter 1这一句在前面加上#号注其实都很简单的,只要你用心学,多在后盾人平台看看教材,慢慢的就都会了
$ wget http://www.ocamlpro.com/pub/opam_installer.sh$ sh opam_installer.sh /usr/local/bin
最后提示:
During this initialisation, you can allow OPAM to add information to two
other files for best results. You can also make theseadditions manually
if you wish.
If you agree, OPAM will modify:
– ~/.bashrc (or a file you specify) to set the right environment
variables and to load the auto-completion scripts for your shell (bash)
on startup. Specifically, it checks for and appends the following line:
. ~/.opam/opam-init/init.sh >/dev/null 2>/dev/null || true
– ~/.ocamlinit to ensure that non-system installations of `ocamlfind`
(i.e. those installed by OPAM) will work correctly when running the
OCaml toplevel. It does this by adding $OCAML_TOPLEVEL_PATH to the list
of include directories.
If you choose to not configure your system now, you can either configure
OPAM manually (instructions will be displayed) or launch the automatic setup
later by running:
`opam config setup -a`.
Do you want OPAM to modify ~/.bashrc and ~/.ocamlinit?
(default is ‘no’, use ‘f’ to name a file other than ~/.bashrc)
[N/y/f] f /etc/profile
1. To configure OPAM in the current shell session, you need to run:
eval `opam config env`
2. To correctly configure OPAM for subsequent use, add the following
line to your profile file (for instance ~/.bashrc):
. /root/.opam/opam-init/init.sh >/dev/null 2>/dev/null || true
3. To avoid issues related to non-system installations of `ocamlfind`
add the following lines to ~/.ocamlinit (create it if necessary):
let () =
try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
with Not_found ->()
To use OCaml installed by OPAM, use
eval `opam config env`
as3:~#
as3:~# ocaml -version
The OCaml toplevel, version 4.01.0
as3:~#
as3:~# opam –version
1.1.0
装完opam后,
opam update
opam install stog (这样就装好了stog)
(具体为:
as3:~# opam update
defaultDownloading https://opam.ocaml.org/urls.txt
defaultDownloading https://opam.ocaml.org/index.tar.gz
Updating ~/.opam/repo/compiler-index …
Updating ~/.opam/compilers/ …
Updating ~/.opam/repo/package-index …
Updating ~/.opam/packages/ …
Updating the cache of metadata (~/.opam/state.cache) …
Everything is up-to-date.
as3:~# opam install stog
The following actions will be performed:
– install ocamlfind.1.4.0 [required by stog]
– install config-file.1.1 [required by stog]
– install ocamlnet.3.7.3 [required by stog]
– install xmlm.1.2.0 [required by stog]
– install ocamlrss.2.2.2 [required by stog]
– install xtmpl.0.7 [required by stog]
– install stog.0.9.0
7 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove
Do you want to continue ? [Y/n] y
=-=-= Installing ocamlfind.1.4.0 =-=-=
ocamlfind.1.4.0 Downloading http://pkgs.fedoraproject.org/lookaside/extras/ocaml-findlib/findlib
-1.4.tar.gz/5d1f8238c53964fdd14387b87b48b5d9/findlib-1.4.tar.gz
Copying ~/.opam/repo/default/packages//ocamlfind/ocamlfind.1.4.0/files/ocamlfind.install to
~/.opam/4.01.0/build/ocamlfind.1.4.0/
Building ocamlfind.1.4.0:
./configure -bindir /root/.opam/4.01.0/bin -sitelib /root/.opam/4.01.0/lib -mandir
/root/.opam/4.01.0/man -config /root/.opam/4.01.0/lib/findlib.conf
make all
make opt
make install
Installing ocamlfind.1.4.0.
=-=-= Installing config-file.1.1 =-=-=
config-file.1.1 Downloading https://forge.ocamlcore.org/frs/download.php/845/config-file-
1.1.tar.gz
Building config-file.1.1:
./configure –prefix /root/.opam/4.01.0
make all
make install
Installing config-file.1.1.
=-=-= Installing ocamlnet.3.7.3 =-=-=
ocamlnet.3.7.3 Downloading http://download.camlcity.org/download/ocamlnet-3.7.3.tar.gz
Copying ~/.opam/repo/default/packages//ocamlnet/ocamlnet.3.7.3/files/ocamlnet.install to
~/.opam/4.01.0/build/ocamlnet.3.7.3/
Building ocamlnet.3.7.3:
./configure -bindir /root/.opam/4.01.0/bin -disable-pcre -disable-gtk2 -disable-ssl -disable-
zip -disable-crypto -with-nethttpd
make all
make opt
make install
Installing ocamlnet.3.7.3.
=-=-= Installing xmlm.1.2.0 =-=-=
xmlm.1.2.0 Downloading http://erratique.ch/software/xmlm/releases/xmlm-1.2.0.tbz
Building xmlm.1.2.0:
./pkg/pkg-git
./pkg/build true
Installing xmlm.1.2.0.
[WARNING] unknown fields in /root/.opam/4.01.0/build/xmlm.1.2.0/xmlm.install: is your OPAM up-to
-date ?
=-=-= Installing ocamlrss.2.2.2 =-=-=
ocamlrss.2.2.2 Downloading http://zoggy.github.io/ocamlrss/ocamlrss-2.2.2.tar.gz
Building ocamlrss.2.2.2:
make
make install
Installing ocamlrss.2.2.2.
=-=-= Installing xtmpl.0.7 =-=-=
xtmpl.0.7 Downloading http://zoggy.github.com/xtmpl/xtmpl-0.7.tar.gz
Building xtmpl.0.7:
make all
make install
Installing xtmpl.0.7.
=-=-= Installing stog.0.9.0 =-=-=
stog.0.9.0 Downloading http://zoggy.github.com/stog/stog-0.9.0.tar.gz
Copying ~/.opam/repo/default/packages//stog/stog.0.9.0/files/stog.install to
~/.opam/4.01.0/build/stog.0.9.0/
Building stog.0.9.0:
make all
make install-lib
Installing stog.0.9.0.
as3:~#)
项目地址:https://github.com/zoggy/stog
http://zoggy.github.io/stog/
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)