Child pages
  • UAPI Functions - LangPHP::php_ini_set_user_content

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Description


Excerpt

This function changes the contents of a virtual host's php.ini file.

Include Page
LIB:_EA4MultiPHPRequired
LIB:_EA4MultiPHPRequired


Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titlecPanel or Webmail Session URL


Code Block
languagexml
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



Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Change the contents of a user's php.ini file.
$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'
		)
);

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

 


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Set the contents of a user's php.ini file.
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'
		)
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 


Expand
titlecPanel Template Toolkit


Code Block
languagexml
linenumberstrue
<!-- Get the content data. -->
[% 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'
		   }
		)
 %]

Include Page
LIB:_TTLink
LIB:_TTLink


Expand
titleCommand Line


Code Block
languagetext
uapi --user=username 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

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
   "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
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


   

Parameters

ParameterTypeDescriptionPossible valuesExample

type

string

Required

The type of php.ini file.

Warning
titleImportant:

If you set this parameter to vhost, you must also include the vhost parameter.  


  • home
  • vhost
vhost
contentstring

Required

The content of the php.ini file to change.

Any valid URL-encoded php.ini file contents.


Expand
titleClick to view...

%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


vhost

string

The name of a virtual host.

Warning
titleImportant:

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.