One of the features of the cloudlinux operating system is multiphp which allows the user to upgrade / downgrade the PHP version, and allows each user to choose the php-extension he needs.

The more PHP versions we activate, the more php.ini we have to edit to match the server conditions we want. In this article we will discuss how to edit php.ini globally, which applies to all versions of alt-php.

1. edit /etc/cl.selector/global_php.ini file with nano or vim editor, and put your global variable you want. for the example:

; This file provides global settings for php.ini of all alt-php packages
; The structure of this file:
; option = value
; To confirm changes (not affecting "date.timezone" and "error_log" options) please run:
; /usr/sbin/cagefsctl --setup-cl-selector
; To confirm changes (including "date.timezone" and "error_log" options) please run:
; /usr/bin/selectorctl --apply-global-php-ini
; or
; /usr/sbin/cagefsctl --apply-global-php-ini
; If you don't want to change error_log, but want to change date.timezone, you can execute
; selectorctl --apply-global-php-ini date.timezone
; Similarly, command
; selectorctl --apply-global-php-ini error_log
; applies error_log and all other options specified in /etc/cl.selector/global_php.ini file, except date.timezone.
; So, you can specify 0, 1 or 2 parameters from the list: error_log, date.timezone
; using --apply-global-php-ini without arguments applies all global php options including two above
; Example:
; selectorctl --apply-global-php-ini error_log
; selectorctl --apply-global-php-ini date.timezone
; selectorctl --apply-global-php-ini date.timezone error_log
; The latter command has the same effect as /usr/bin/selectorctl --apply-global-php-ini
[Global PHP Settings]
max_execution_time = 120
memory_limit = 96M
upload_max_filesize = 70M
post_max_size = 70M
disable_functions = mail,show_source,symlink,system,shell_eval,define_syslog_variables,syslog,openlog,closelog,passthru,ocinumcols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_dl,dll,ftp,myshellsocket_bind,popen,fpassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_pcntl_getpriority,pcntl_setpriority,str_rot13
date.timezone = "Asia/Jakarta"

2. Save file
3. Apply modified item with this command to all alt-php:

/usr/sbin/cagefsctl --apply-global-php-ini

Write A Comment