At one project i’m working on i had to upload php files in a TYPO3 backend form. But the form was just throwing me the message that php files are not allowed as uploads. After some digging i found the solution to this problem. Actually it’s quite easy to fix.
The only thing you need to do is to add the following configurations directives into TYPO3’s localconf.php file:
$TYPO3_CONF_VARS['BE']['fileExtensions']['webspace']['allow'] = 'php'; $TYPO3_CONF_VARS['BE']['fileExtensions']['webspace']['deny'] = ''; $TYPO3_CONF_VARS['BE']['fileDenyPattern'] = '';
After you did this you should clear the cache and you should be able to upload php files.
NOTE: Allow upload of php files only in situations when you know for sure that these are files or users that can be trusted. Allowing the upload of unverified php files by untrusted users poses a GREAT SECURITY RISK!
2 comments
Hmm I can’t think of a situation when you need to upload PHP files, but cool anyways.
Works perfectly fine. However, please note, that enabling PHP file uploads and editing PHP files introduces a serious security risk!
See official TYPO3 Security Guide:
http://typo3.org/documentation/document-library/core-documentation/doc_guide_security/current/