[pmwiki-users] How to upload php scripts and download them as plain text?

Patrick R. Michaud pmichaud at pobox.com
Fri Feb 10 07:42:53 CST 2006


On Fri, Feb 10, 2006 at 12:19:34PM +0100, Sebastian Siedentopf wrote:
> I want to put php scripts for download on a wiki page. But I'm tired  
> of renaming them to xxx.php.txt so I want the same behaviour as on  
> pmwiki.org.
> 
> Using 2.1b24 I added
> 
>      $UploadExts['php'] = 'text/plain';
> 
> in my config.php. Upload is fine, but at download they are executed  
> and not handled as txt files.

You have to either:

1. Tell your webserver not to execute .php files in the uploads/ directory.
   I do this on pmwiki.org using a .htaccess file in uploads/  :

        AddType text/plain .php

2. Don't use direct downloads -- set $EnableDirectDownload = 0;
   in local/config.php.  This tells PmWiki to handle the downloads
   itself rather than letting the webserver do it.

Pm




More information about the pmwiki-users mailing list