Description
This function changes the contents of a virtual host's php.ini
file.
Examples
cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_ini_set_user_content?type=vhost&vhost=clearly.com&content=%5BPHP%5D%0D%0A%3B+About+php.ini%0D%0A%3B+php.ini+is+responsible+for+configuring+many+of+the+aspects+of+PHP%27s+behavior.%0D%0Apcre.backtrack_limit%3D100000
LiveAPI PHP Class
$cpanel
=
new
CPANEL();
$php_ini_set_user_content
=
$cpanel
->uapi(
'LangPHP'
,
'php_ini_set_user_content'
,
array
(
'type'
=>
'vhost'
,
'vhost'
=>
'clearly.com'
,
'content'
=>
'%5BPHP%5D%0D%0A%3B+About+php.ini%0D%0A%3B+php.ini+is+responsible+for+configuring+many+of+the+aspects+of+PHP%27s+behavior.%0D%0Apcre.backtrack_limit%3D100000'
)
);
LiveAPI Perl Module
my
$cpliveapi
= Cpanel::LiveAPI->new();
my
$php_ini_set_user_content
=
$cpliveapi
->uapi(
'LangPHP'
,
'php_ini_set_user_content'
,
(
'type'
=>
'vhost'
,
'vhost'
=>
'clearly.com'
,
'content'
=>
'%5BPHP%5D%0D%0A%3B+About+php.ini%0D%0A%3B+php.ini+is+responsible+for+configuring+many+of+the+aspects+of+PHP%27s+behavior.%0D%0Apcre.backtrack_limit%3D100000'
)
);
cPanel Template Toolkit
[% execute('LangPHP', 'php_ini_set_user_content', {'type' => 'vhost',
'vhost' => 'clearly.com',
'content' => '%5BPHP%5D%0D%0A%3B+About+php.ini%0D%0A%3B+php.ini+is+responsible+for+configuring+many+of+the+aspects+of+PHP%27s+behavior.%0D%0Apcre.backtrack_limit%3D100000'
}
)
%]
Command Line
[% execute('LangPHP', 'php_ini_set_user_content', {'type' => 'vhost',
'vhost' => 'clearly.com',
'content' => '%5BPHP%5D%0D%0A%3B+About+php.ini%0D%0A%3B+php.ini+is+responsible+for+configuring+many+of+the+aspects+of+PHP%27s+behavior.%0D%0Apcre.backtrack_limit%3D100000'
}
)
%]
Output (JSON)
{
"messages":null,
"errors":null,
"status":1,
"metadata":{
"LangPHP":{
"vhost":"clearly.com",
"phpversion":"ea-php55",
"type":"vhost",
"path":"/home/allthethings/public_html/php.ini"
}
},
"data":null
}
Parameters
Parameter
|
Type
|
Description
|
Possible values
|
Example
|
type
|
string
|
Required
The type of php.ini file.
Important:
If you set this parameter to vhost, you must also include the vhost parameter.
|
|
vhost
|
content
|
string
|
Required
The content of the php.ini file to change.
|
Any valid URL-encodedphp.ini file contents.
|
|
vhost
|
string
|
The name of a virtual host.
Important:
If the type value is vhost, you must use this parameter.
|
A virtual host on the system.
|
clearly.com
|
Returns
This function returns only metadata.