PHP Settings - plugin to edit CGI/FPM php.ini via DA control panel

Are you interested in this plugin?

  • No

    Votes: 0 0.0%
  • Not now

    Votes: 0 0.0%
  • May be

    Votes: 0 0.0%

  • Total voters
    6
  • Poll closed .

roman_m

Verified User
Joined
May 5, 2005
Messages
193
Location
Ukraine, Kiev
Hi!

Are you interested in DA plugin to edit per-user-domain php.ini settings via DA control panel ? It's highly configurable and useful when you run your PHP installation as FCGI/FPM and/or with suPHP. I think, it might be rewritten for use with .htaccess and/or php-fpm.conf, but as always I have a lack of time to develop it, so I proudly present my plugin source to DA comunity.

Some screenshots

http://i.imgur.com/EnxwSlY.png
http://i.imgur.com/Vi0eQg7.png

I will attach plugin source if anybody interests in it.
 
Hi friend,
Maybe you can not believe it!
But i wanted to write sth. like it next month!!!!!!
I will be happy if you could share it with us.
or maybe send it to me using PM.

Thanks a lot!

Regards
 
Nice to see you Roman, some of us were worried about you since you wasnt online from a long time :)

Hope everything is fine :)

Nice plugin, i would like it aswell, also, since you wrote DirectSlave i was going to try to contact you to implement in it the new feature for E-Mail Account sync :D

Best regards
 
Looks very nice, might realy be of use. But like Sellerone I'm glad to see you and was a bit worried. Hope you're all well!
 
My favorite panel still don't have plugin to match php.ini editor in CPanel & ISPmanager?
Damn, I have to write it by myself(
 
+1 for this plugin, we can do then disable_function per user I assume ?
 
+1 for this plugin, we can do then disable_function per user I assume ?

Yes, plugin have own global configuraion file .

Code:
php_admin_value allow_url_fopen On ; select On:Off
php_admin_value allow_url_include On ; select On:Off
php_admin_value date.timezone Europe/Kiev ; select Europe/Amsterdam:Europe/Andorra:Europe/Athens:Europe/Belfast:Europe/Belgrade:Europe/Berlin:Europe/Bratislava:Europe/Brussels:Europe/Bucharest:Europe/Budapest:Europe/Busingen:Europe/Chisinau:Europe/Copenhagen:Europe/Dublin:Europe/Gibraltar:Europe/Guernsey:Europe/Helsinki:Europe/Isle_of_Man:Europe/Istanbul:Europe/Jersey:Europe/Kaliningrad:Europe/Kiev:Europe/Lisbon:Europe/Ljubljana:Europe/London:Europe/Luxembourg:Europe/Madrid:Europe/Malta:Europe/Mariehamn:Europe/Minsk:Europe/Monaco:Europe/Moscow:Europe/Nicosia:Europe/Oslo:Europe/Paris:Europe/Podgorica:Europe/Prague:Europe/Riga:Europe/Rome:Europe/Samara:Europe/San_Marino:Europe/Sarajevo:Europe/Simferopol:Europe/Skopje:Europe/Sofia:Europe/Stockholm:Europe/Tallinn:Europe/Tirane:Europe/Tiraspol:Europe/Uzhgorod:Europe/Vaduz:Europe/Vatican:Europe/Vienna:Europe/Vilnius:Europe/Volgograd:Europe/Warsaw:Europe/Zagreb:Europe/Zaporozhye:Europe/Zurich
php_admin_value disable_functions none ; checkbox mail:exec:passthru:shell_exec:system:proc_open:popen:curl_exec:curl_multi_exec:parse_ini_file:show_source:base64_encode:base64_decode:socket_connect:ini_set
php_admin_value display_errors On ; select On:Off
php_admin_value error_log /home/[% user %]/domains/[% domain %]/logs/php.error.log ; path userdir
php_admin_value error_reporting E_ALL & ~E_NOTICE ; text default
php_admin_value log_errors On ; select On:Off
php_admin_value max_execution_time [% phpexectime %] ; select 10:15:30:60:120:240:300
php_admin_value max_input_time [% phpexectime %] ; select 10:15:30:60:120:240:300
php_admin_value max_input_vars 5000 ; text default
php_admin_value memory_limit [% phpmem %]M ; select 32M:64M
php_admin_value opcache.enable On ; select On:Off
php_admin_value post_max_size [% phpmem %]M ; select 10M:20M:50M:100M:200M

and so on.
 
Yes, plugin have own global configuraion file .

Code:
php_admin_value allow_url_fopen On ; select On:Off
php_admin_value allow_url_include On ; select On:Off
php_admin_value date.timezone Europe/Kiev ; select Europe/Amsterdam:Europe/Andorra:Europe/Athens:Europe/Belfast:Europe/Belgrade:Europe/Berlin:Europe/Bratislava:Europe/Brussels:Europe/Bucharest:Europe/Budapest:Europe/Busingen:Europe/Chisinau:Europe/Copenhagen:Europe/Dublin:Europe/Gibraltar:Europe/Guernsey:Europe/Helsinki:Europe/Isle_of_Man:Europe/Istanbul:Europe/Jersey:Europe/Kaliningrad:Europe/Kiev:Europe/Lisbon:Europe/Ljubljana:Europe/London:Europe/Luxembourg:Europe/Madrid:Europe/Malta:Europe/Mariehamn:Europe/Minsk:Europe/Monaco:Europe/Moscow:Europe/Nicosia:Europe/Oslo:Europe/Paris:Europe/Podgorica:Europe/Prague:Europe/Riga:Europe/Rome:Europe/Samara:Europe/San_Marino:Europe/Sarajevo:Europe/Simferopol:Europe/Skopje:Europe/Sofia:Europe/Stockholm:Europe/Tallinn:Europe/Tirane:Europe/Tiraspol:Europe/Uzhgorod:Europe/Vaduz:Europe/Vatican:Europe/Vienna:Europe/Vilnius:Europe/Volgograd:Europe/Warsaw:Europe/Zagreb:Europe/Zaporozhye:Europe/Zurich
php_admin_value disable_functions none ; checkbox mail:exec:passthru:shell_exec:system:proc_open:popen:curl_exec:curl_multi_exec:parse_ini_file:show_source:base64_encode:base64_decode:socket_connect:ini_set
php_admin_value display_errors On ; select On:Off
php_admin_value error_log /home/[% user %]/domains/[% domain %]/logs/php.error.log ; path userdir
php_admin_value error_reporting E_ALL & ~E_NOTICE ; text default
php_admin_value log_errors On ; select On:Off
php_admin_value max_execution_time [% phpexectime %] ; select 10:15:30:60:120:240:300
php_admin_value max_input_time [% phpexectime %] ; select 10:15:30:60:120:240:300
php_admin_value max_input_vars 5000 ; text default
php_admin_value memory_limit [% phpmem %]M ; select 32M:64M
php_admin_value opcache.enable On ; select On:Off
php_admin_value post_max_size [% phpmem %]M ; select 10M:20M:50M:100M:200M

and so on.
Is there an update on this plugin ? :) i would love to use it.
 
Let's first public beta begins!

Code:
-------------
Configuration
-------------

See phpini/data/phpini.conf

### Setup

!!! Check `perl` path. If it's not /usr/local/bin/perl, create symlink in /usr/local/bin !!!
require CGI module, install it from your distribution repo.

Set user_run_as=webserver in

### Allowed variables:

$user   - is for user name
$domain - is for domain

### Options
$inifile - where is user/domain php.ini stored. If no php.ini file exist,
            it will be created on first user access to /CMD_PLUGINS/phpini
            For per-domain php.ini in "apache" mode $inifile looks like this:
            $inifile  = "/var/www/.php/".$domain.".php.ini";
            For per-user php.ini in "fpm" mode $inifile looks like this:
            $inifile  = "/var/www/.php/".$user.".php.ini";
$phplim  - where is limits file stored. Can be per-domain, per-user & server-wide
            $user.limits example in /usr/local/directadmin/plugins/phpini/data/user.limits
            You can generate per-user / per-domain .limits file using DirectAdmin custom items
            and custom user_create_post.sh & user_modify_post.sh
$phpmode - apache or fpm. For LiteSpeed Enterprise use "apache". OpenLiteSpeed is not supported.
            CGI/FastCGI is not supported (who use CGI in 2020?)

### php.ini files
2 files located in phpini/data/. See phpini/README for file format & option settings

------------------------
.ini template formatting
------------------------

memory_limit = 32M ; select 16M:32M:64M:128M:256M

memory_limit - parameter
32M - value
; - divider
select - user interface element (dropdown menu)
16M:32M:64M:128M:256M - parameters for element (divided by colon)
[% user %] - substituted by username (login), used for "path" element
[% domain %] - substituted by domain, used for "path" element

------------------
Interface elements
------------------

text default - text field
hidden default - hidden string, user cant' see it and cant' change it
path userdir - path for logfiles, session files etc, relative to user home directory (/home/$user/)
path system - system wide path from /
checkbox - group of checkboxes, followed by elements belonging to group
select - dropdown menu, folllowed by elements belonging to menu

-----------
Translation
-----------
Translation files located in data/lang
Just copy file en.txt as you language code .txt (pl.txt, for Polska, de.txt for Deutsch)
and edit it as you want on accordance with your language, every enrty in a single line.

Every settings from php.ini must contain its own string in UPPERCASE format in translation file.
Also you can insert basic HTML (links, tags, styles) elements into strings.
Feel free to create as many entries as you want.

https://directslave.com/download/phpini.tar.gz
 
Details


plugin.tar.gz extracted
No install.sh script was found. Script not executed.
Error with install script​
 
No. It require manual configuration and deep php.ini knowledge, PHP working mode and file locations understanding.

It's non-commercial open-source, provided as-is. No further modifications planned.
 
Back
Top