dokuwiki支持PDF导出插件(PHP)

好久没写了,会不会写错别字,好紧张。。。
先说搭建dokuwiki。所有搭建过程都是从网上找的,找到的很多总是不全,所以搭建完成费了点劲,
这里总结写,免得以后要用,又得重来。

首先是安装http(也就是web服务):
1、apr-1.3.5.tar.gz
(APR(Apache portable Run-time libraries,Apache可移植运行库)的目的如其名称一样,主要为上层的应用程序提供一个可以跨越多操作系统平台使用的底层支持接口库。)
下载地址:http://apr.apache.org/download.cgi

 #tar zxvf apr-1.3.5.tar.gz 
 #cd apr-1.3.5
 #./configure 
 #make 
 #make install 

2、apr-util-1.3.7.tar.gz
下载地址:http://apr.apache.org/download.cgi

 # tar zxvf apr-util-1.3.7.tar.gz
   # cd apr-util-1.3.7
   # . /configure --with-apr=/usr/local/apr
   # make
   # make install

3、httpd-2.2.11.tar.gz
(apr和apache的版本要对应,如果Apache为2.0.x,对应的APR版本应为0.9.x;Apache为2.2.x,对应的APR版本应为1.2以上版本)

下载地址:http://httpd.apache.org/download.cgi

 # tar zxvf httpd-2.2.11.tar.gz
 # ./configure --prefix=/usr/local/apache2 --enable-dav \
 --enable-modules=so --enable-maintainer-mode \
--with-apr=/usr/local/apr/bin/apr-1-config \
 --with-apr-util=/usr/local/apr/bin/apu-1-config
 # make
 # make install

4.安装PDFlib
因为就要实现PDF,因此在安装PHP之前需要安装PDFlib库。
Linux版本源码:pdflib-4.0.2.tar.gz(http://www.pdflib.com/pdflib/download/pdflib-4.0.2.tar.gz)

# tar xvfz pdflib-*.tar.gz
# cd pdflib-*
# ./configure --with-share
# make
# make install

5.安装PHP
Linux版本源码:
php-4.1.2.tar.gz(http://www.php.net/do_download.php?download_file=php-4.1.2.tar.gz)

 # tar xvfz php-*.tar.gz
 # cd php-* \
--with-mysql=/usr/local/mysql \
--with-apxs=/usr/local/apache2/bin/apxs \
--with-libxml-dir=/usr/local/libxml2 \
--with-pdflib=/usr/lib \
--with-mbstring \
--with-libmcrypt=/usr/lib/libmcrypt 

注意:最后的两个参数一定要包含:pdflib、mcrypt
其中pdflib的下载地址是:http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-7.0.5p3.tar.gz
至于mcrypt:直接yum install php-mbstring.x86_64(对于CentOS Linux),至于其他则用apt-get
6、安装dokuwiki
//下载网站安装压缩包
#wget -c http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
//解包解压缩
#tar -zvxf dokuwiki-stable.tgz
//复制解压的 网站源码文件到网站根目录
#cp -r dokuwiki-2013-05-10a/* /var/www/html/wik
可能需要如下依赖包:
gcc-c++、make、expat-devel、perl、curl-devel、libxml2-devel、 libjpeg-devel、libpng-devel、freetype-deve
7、更改 httpd.conf
# vi /etc/httpd/conf/httpd.conf
将 DocumentRoot 目录更改到第4步中的dokuwiki路径下 默认为/var/www/html下面配置作用是对URL进行过滤以保证数据安全

<LocationMatch "/wiki/(data|conf|bin|inc)/">
    Order allow,deny
    Deny from all
    Satisfy all
</LocationMatch>

8、修改权限
根据httpd.conf 中下述两个配置值进行修改
User apache
Group apache
权限不修改会导致下面的访问页面报错
#chown -R apache.apache/var/www/html/wiki//将文件所有者由root用户改为apache用户
9、调整Apache mime设定,让Apache 可以支援 PHP (/etc/mime.types ) ,在配置中加入
application/x-httpd-php php php4 phtml
application/x-httpd-php-source phps
10、重启 Apache ( service httpd restart ),连接到 Wiki 下的目录执行 install.php 进行安装设定(http://IP或者域名/wiki/install.php?l=zh)

至此dokuwiki算是搭建完成,一下是安装插件
在dokuwiki安装PDF插件
只需将插件下载下来到:/var/www/html/wiki/lib/plugins/dw2pdf
dw2pdf 是我PDF安装的插件的目录名字

最后重启php和http服务(apachectl restart 、service httpd restart),至此大功告成。

参考网址如下:
1、http://blog.csdn.net/hgf_tc/article/details/44457287
2、http://www.cnblogs.com/fly1988happy/archive/2011/12/14/2288096.html
3、http://blog.csdn.net/default7/article/details/32312061
4、http://stackoverflow.com/questions/12708855/ensure-that-php-is-compiled-with-php-mbstring-dll-enabled
5、http://www.2cto.com/kf/201601/457377.html
6、http://blog.163.com/hlz_2599/blog/static/14237847420134131062360/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值