Difference between revisions of "Template:PHP/open basedir"

From wiki
(typo)
(Reload instead of restart)
 
(2 intermediate revisions by the same user not shown)
Line 10: Line 10:
 
"type": "string",
 
"type": "string",
 
"required": true
 
"required": true
 +
},
 +
"reload": {
 +
"label": "Reload php",
 +
"type": "boolean",
 +
"default": "1",
 +
"suggested": true
 
}
 
}
 
},
 
},
"description": "Edit the PHP setting open_basedir"
+
"description": "Edit the PHP setting open_basedir",
 +
"format": "block"
 
}
 
}
 
</templatedata>
 
</templatedata>
Line 21: Line 28:
 
{{PHP/open_basedir|folders=/var/lib/roundcube/:/usr/share/roundcube/}}
 
{{PHP/open_basedir|folders=/var/lib/roundcube/:/usr/share/roundcube/}}
  
</noinclude><includeonly>Edit file <code>[[PHP#Common_configuration|/etc/php5/mods-available/local-common.ini]]</code> and add <code>{{{folders}}}</code> to the [[PHP#Limit_File_Access|<code>open_basedir</code> setting]].</includeonly>
+
</noinclude><includeonly>Edit file <code>[[PHP#Common_configuration|/etc/php/7.0/mods-available/local-common.ini]]</code> and add <code>{{{folders}}}</code> to the [[PHP#Limit_File_Access|<code>open_basedir</code> setting]].{{#ifexpr: {{{reload|1}}} | <nowiki/>
 +
 
 +
Reload PHP:
 +
<syntaxhighlight lang="console">
 +
$ sudo systemctl reload php7.0-fpm.service
 +
</syntaxhighlight>
 +
}}</includeonly>

Latest revision as of 09:24, 24 June 2017

Description

Edit the PHP setting open_basedir

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Folderfolders

Column separated list of folders

Example
/var/lib/roundcube/:/usr/share/roundcube/
Stringrequired
Reload phpreload

no description

Default
1
Booleansuggested

Example

{{PHP/open_basedir|folders=/var/lib/roundcube/:/usr/share/roundcube/}}

Edit file /etc/php/7.0/mods-available/local-common.ini and add /var/lib/roundcube/:/usr/share/roundcube/ to the open_basedir setting.

Reload PHP:

$ sudo systemctl reload php7.0-fpm.service