1

I put the following code in .user.ini file under apache virtual host document root. And when I view the phpinfo() output, the disable_functions fields says "no value". Please help me to figure out why.

(The "memory_limit" and "max_execution_time" are setting correctly.)

Thanks in advance.

memory_limit = 2048M
max_execution_time = 3600
disable_functions = apache_child_terminate,apache_get_modules,apache_getenv,apache_note,apache_setenv,curl_multi_exec,define_syslog_variables,disk_free_space,diskfreespace,dl,fpassthru,ftp_connect,ftp_exec,ftp_get,ftp_login,ftp_nb_fput,ftp_put,ftp_raw,ftp_rawlist,get_current_user,getmyuid,highlight_file,ini_alter,ini_get_all,ini_restore,link,ini_set,mysql_list_dbs,openlog,parse_ini_file,passthru,pclose,pcntl_exec,pfsockopen,php_uname,pcntl_alarm,pcntl_fork,pcntl_get_last_error,pcntl_signal,pcntl_getpriority,pcntl_setpriority,pcntl_strerror,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_waitpid,pcntl_wait,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,popen,posix_getgrgid,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,posix_setuid,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,socket_accept,socket_bind,socket_create,socket_create_listen,socket_create_pair,socket_listen,shell_exec,show_source,socket_select,socket_strerror,stream_select,syslog,symlink,system

3 Answers 3

3

@Charles is right, the PHP Manual clearly states that disable_functions can only be set in the master php.ini. This clearly defeats per-vhost custom value.

There's a workaround for this if you have uopz PECL extension enabled. Check my other answer for details.

Sign up to request clarification or add additional context in comments.

Comments

0

You need to enclose that with "

disable_functions = "apache_child_terminate,apache_get_modules,apache_getenv,apache_note,apache_setenv,curl_multi_exec,define_syslog_variables,disk_free_space,diskfreespace,dl,fpassthru,ftp_connect,ftp_exec,ftp_get,ftp_login,ftp_nb_fput,ftp_put,ftp_raw,ftp_rawlist,get_current_user,getmyuid,highlight_file,ini_alter,ini_get_all,ini_restore,link,ini_set,mysql_list_dbs,openlog,parse_ini_file,passthru,pclose,pcntl_exec,pfsockopen,php_uname,pcntl_alarm,pcntl_fork,pcntl_get_last_error,pcntl_signal,pcntl_getpriority,pcntl_setpriority,pcntl_strerror,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_waitpid,pcntl_wait,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,popen,posix_getgrgid,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,posix_setuid,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,socket_accept,socket_bind,socket_create,socket_create_listen,socket_create_pair,socket_listen,shell_exec,show_source,socket_select,socket_strerror,stream_select,syslog,symlink,system"

2 Comments

I tried that, but it is not working. And when I put the same function list in the global php.ini file, it is working. So the format is correct. But I want different apache virtual host has different disable_functions list, that is why I cannot put it into the global php.ini
i doubt this is the right answer, this one is exactly the opposite: stackoverflow.com/a/16799401/1174784
0

I just looked at the php.ini derective page carefully and I found disable_function's changeable field is php.ini only. So it will only be changed inside the global php.ini file. And I am afraid that I have to find another way to implement my requirement. If anybody can give me some suggestion about how to assign different disable_functions list to different apache vritual hosts, that will be super helpful. Cheers.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.