Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TetraWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Wiki.tetrain.com Runbook
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 9.1 PDF uploads === <pre> <nowiki> cp /var/www/wiki/LocalSettings.php /var/www/wiki/LocalSettings.php.bak.$(date +%Y%m%d%H%M%S) </nowiki> </pre> Add to <code><nowiki>LocalSettings.php</nowiki></code>, right after <code><nowiki>$wgEnableUploads = true;</nowiki></code>: <pre> <nowiki> $wgFileExtensions = array_merge( $wgFileExtensions ?? [ 'png', 'gif', 'jpg', 'jpeg' ], [ 'pdf' ] ); </nowiki> </pre> Add after the other <code><nowiki>wfLoadExtension()</nowiki></code> calls: <pre> <nowiki> wfLoadExtension( 'PdfHandler' ); </nowiki> </pre> <code><nowiki>PdfHandler</nowiki></code> ships bundled inside the 1.43.9 tarball already on disk (Phase 5) β it just isn't loaded by default, no separate download needed. <code><nowiki>PdfHandler</nowiki></code> needs four system binaries it depends on for rendering/thumbnailing/text-indexing, none of which were present on the box: <pre> <nowiki> dnf install -y ghostscript poppler-utils ImageMagick # provides: gs ($wgPdfProcessor), convert ($wgPdfPostProcessor), # pdfinfo ($wgPdfInfo), pdftotext ($wgPdftoText) β all four are MediaWiki defaults, # no explicit $wgPdf* overrides were needed once the binaries existed on PATH </nowiki> </pre> (This <code><nowiki>dnf install</nowiki></code> hit the 60s SSH command timeout mid-transaction β verified separately via <code><nowiki>rpm -qa | grep -iE 'ghostscript|poppler-utils|ImageMagick'</nowiki></code> and <code><nowiki>which gs convert pdfinfo pdftotext</nowiki></code> that it had actually completed; not re-run.) '''Verify''': <pre> <nowiki> curl -s 'https://wiki.tetrain.com/api.php?action=query&meta=siteinfo&siprop=fileextensions&format=json' # confirm "pdf" present in the list </nowiki> </pre> Also checked <code><nowiki>Special:Version</nowiki></code> on the live wiki β confirms "PDF Handler" registered as a loaded extension.
Summary:
Please note that all contributions to TetraWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TetraWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)