Hi, I have made a fresh install on Ubuntu Server 9.10 (up to date with safe-upgrade). Installed the Collection from latest repositories, used CGI method to use the mwlib BUT can not Download the PDF. If I rename 'output.rl' file to 'output.pdf' in MW CACHE folder I see expected result properly rendered.
the mwlib.cgi.log just gives: 2010-04-23T17:14:56 mwlib.serve.info >> render_status 67e7d299a70950dc rl 2010-04-23T17:14:56 mwlib.serve.info >> download 67e7d299a70950dc rl and nothing hapens in IE or Firefox. The PHP is 5.2.10.dfsg.1-2ubuntu6.4. Is this because of the same bug? Can it be solved without the upgrade of the PHP. I am also attaching notes of the Installation procedure: --------------------------------------------------------------------------------- -- MWLIB -- sudo aptitude install g++ perl python python-dev python-setuptools python-imaging sudo easy_install mwlib - am...@rramwsr:~/Downloads/MediaWiki/extensions$ sudo easy_install mwlib && rehash Searching for mwlib Reading http://pypi.python.org/simple/mwlib/ Reading http://code.pediapress.com/ Best match: mwlib 0.12.12 Downloading http://pypi.python.org/packages/source/m/mwlib/mwlib-0.12.12.tar.gz#md5=3b13d173f91ad70283fe2799e70905aa Processing mwlib-0.12.12.tar.gz ... - -- MWLIB.RL -- sudo aptitude install gs cjk-latex tetex-extra python-pyfribidi libfribidi0 libfribidi-dev python-pygments imagemagick subversion python-setuptools sudo aptitude install make binutils gcc ocaml BUILD TeXVC cd /home/amwsr/Downloads/ svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/math texvc.svn - ... Checked out revision 65460. - cd texvc.svn && make && sudo cp texvc /usr/local/bin/ && cd .. sudo easy_install mwlib.rl - Searching for mwlib.rl Reading http://pypi.python.org/simple/mwlib.rl/ Reading http://code.pediapress.com/ Best match: mwlib.rl 0.12.4 Downloading http://pypi.python.org/packages/source/m/mwlib.rl/mwlib.rl-0.12.4.tar.gz#md5=26673a4cc859e020015e139fb0a5b12c Processing mwlib.rl-0.12.4.tar.gz ... - -- TOC - Install tables of contents for mwlib.rl -- sudo aptitude install pdftk This will a visible TOC in the beginning of the book if installed (nothing else to do, mwlib.rl will detect this library). So far this TOC does not have hyperlinks (but users can open the bookmarks to left and they do of course). -- TEST: -- mw-render --list-writers - am...@rramwsr:~/Downloads$ mw-render --list-writers xhtml XHTML 1.0 Transitional odf OpenDocument Text docbook <NOT LOADABLE: No module named lxml> font not found: ttf-sil-ezra/SILEOT.ttf font not found: arphic/uming.ttc font not found: ttf-farsiweb/nazli.ttf font not found: unfonts/UnBatang.ttf font not found: ttf-thai-arundina/ArundinaSans.ttf font not found: ttf-telugu-fonts/lohit_te.ttf font not found: ttf-devanagari-fonts/Sarai_07.ttf font not found: ttf-indic-fonts-core/lohit_pa.ttf font not found: ttf-oriya-fonts/lohit_or.ttf font not found: ttf-malayalam-fonts/AnjaliOldLipi.ttf font not found: ttf-kannada-fonts/Kedage-n.ttf font not found: ttf-bengali-fonts/LikhanNormal.ttf font not found: ttf-indic-fonts-core/lohit_ta.ttf rl PDF documents (using ReportLab) - OPCIJSKO: Install extra fonts - NOT NEEDED sudo aptitude install ttf-indic-fonts ttf-unfonts ttf-farsiweb ttf- arphic-uming ttf-gfs-artemisia ttf-sil-ezra ttf-thai-arundina linux- libertine In file fontconfig.py font_paths = [os.path.dirname(mwlib.fonts.__file__), os.path.expanduser('~/mwlibfonts/') ] This under the assumption that the fonts are in the directory mwlib.rl.hg/mwlib/fonts or ~/mwlibfonts/ of the user that installs or root if you install as root. -- Configure styling - MAYBE LATER -- Customizing the resulting PDFs is possible by adding a custom configuration file. The file needs to named customconfig.py and should reside next to the pdfstyles.py file. Basically you can override anything in the pdfstyles.py file with your custom configuration. sudo cp /usr/local/lib/python2.6/dist-packages/mwlib.rl-0.12.4- py2.6.egg/mwlib/rl/pdfstyles.py /usr/local/lib/python2.6/dist-packages/ mwlib.rl-0.12.4-py2.6.egg/mwlib/rl/customconfig.py sudo vi /usr/local/lib/python2.6/dist-packages/mwlib.rl-0.12.4- py2.6.egg/mwlib/rl/customconfig.py --- SETUP Apache in mwlib.cgi --- sudo mkdir /var/cache/mwlib sudo chown -R apache /var/cache/mwlib/ EDIT mwlib.cgi FROM mwlib source and copy it to cgi-bin dir (e.g. I made a cgi-bin under mediawiki) sudo vi /var/lib/mediawiki/cgi-bin/mwlib.cgi - #! /usr/bin/env python """This is the "CGI equivalent" of mw-serve. Adjust the configuration variables below and install this script as CGI script for your web server. """ # Configuration: # Name of logfile or None if log output should go to stderr. #LOGFILE = None LOGFILE = '/var/log/mwlib.cgi.log' # Cache directory. Must be writeable. CACHE_DIR = '/var/cache/mw-serve/' # (Path to) mw-render executable. MWRENDER = 'mw-render' # Logfile for mw-render. MWRENDER_LOGFILE = '/var/log/mw-render.log' #MWRENDER_LOGFILE = None # (Path to) mw-zip executable. MWZIP = 'mw-zip' # Logfile for mw-zip. MWZIP_LOGFILE = '/var/log/mw-zip.log' #MWZIP_LOGFILE = None # (Path to) mw-post executable. MWPOST = 'mw-post' # Logfile for mw-post. MWPOST_LOGFILE = '/var/log/mw-post.log' #MWPOST_LOGFILE = None # Queue directory for mw-watch or None if no queue should be used QUEUE_DIR = None #QUEUE_DIR = '/var/cache/mw-watch/q' # ============================================================================== import os import sys from flup.server.cgi import WSGIServer from mwlib import serve, utils if os.name == 'nt': import msvcrt if hasattr(sys.stdout, 'fileno') and sys.stdout.fileno() >= 0: msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) if LOGFILE is not None: utils.start_logging(LOGFILE, stderr_only=True) WSGIServer(serve.Application( cache_dir=CACHE_DIR, mwrender_cmd=MWRENDER, mwrender_logfile=MWRENDER_LOGFILE, mwzip_cmd=MWZIP, mwzip_logfile=MWZIP_LOGFILE, mwpost_cmd=MWPOST, mwpost_logfile=MWPOST_LOGFILE, queue_dir=QUEUE_DIR, )).run() - --- PHP Curl --- Install php-curl sudo aptitude install php5-curl sudo /etc/init.d/apache2 restart --- INSTALL Plugin/Extension Collection --- First get the latest to the temp dir /home/amwsr/Downloads/MediaWiki/ extensions svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Collection/ - am...@rramwsr:~/Downloads/MediaWiki/extensions$ svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Collection/ A Collection/Collection.i18n.php A Collection/Collection.php A Collection/Collection.suggest.php A Collection/Collection.hooks.php A Collection/Collection.session.php A Collection/images A Collection/images/remove.png A Collection/images/silk-remove.png A Collection/images/silk-accept.png A Collection/images/collapse.png A Collection/images/disabled.png A Collection/images/down.png A Collection/images/green-button-back.png A Collection/images/Open_book.png A Collection/images/silk-book_open.png A Collection/images/expand.png A Collection/images/show.png A Collection/images/red-button-back.png A Collection/images/up.png A Collection/images/silk-cancel.png A Collection/images/trans.png A Collection/images/silk-help.png A Collection/images/silk-add.png A Collection/images/silk-wand.png A Collection/CollectionCore.i18n.php A Collection/Collection.alias.php A Collection/README.txt A Collection/collection A Collection/js A Collection/js/bookcreator.js A Collection/js/collection.js A Collection/js/jquery.ui.js A Collection/js/json2.js A Collection/js/jquery.js A Collection/js/suggest.js A Collection/Collection.body.php A Collection/Collection.templates.php Checked out revision 65460. - Copy to MediaWiki sudo cp -r Collection/ /var/lib/mediawiki/extensions --- MediaWiki SETUP --- sudo vi /var/lib/mediawiki/LocalSettings.php ADD: # Collections Extension (PDF, ODF export) require_once("$IP/extensions/Collection/Collection.php"); #$wgCollectionMWServeURL = "http://tools.pediapress.com/mw-serve/"; $wgCollectionMWServeURL = "http://localhost/wiki/cgi-bin/mwlib.cgi"; $wgCollectionFormats = array( 'rl' => 'PDF', 'odf' => 'ODT',); $wgCollectionPortletFormat = array( 'PDF', 'ODT',); ---------------------------------------------------------------------------------------------------- On Apr 21, 5:56 am, leif wang <gemini...@gmail.com> wrote: > The issue has been solved. It's a bug of PHP 5.3 that tmpfile() is not > writable. After i upgrade to 5.3.1. The pdf download works well now. > > Thank your for all your help. Hope this can also help others. > > leif > > 2010/4/21 leif wang <gemini...@gmail.com> > > > -- You received this message because you are subscribed to the Google Groups "mwlib" group. To post to this group, send email to mw...@googlegroups.com. To unsubscribe from this group, send email to mwlib+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/mwlib?hl=en.