Solved PHP Setting Override.. working or not?

alrnetwork

Verified User
Joined
Feb 12, 2021
Messages
162
Location
Europe UTC+2
So, I don't understand how the PHP Settings Override function works. I mean, on the face of it.. seems pretty simple.. but nothing I add there seems to be working at all.

For example:
Screenshot 2022-08-17 at 12.10.15.png
However, on the WordPress installation it still shows "30"
Screenshot 2022-08-17 at 12.11.59.png

The changes there have all been performed in the php.ini files themselves.. on the server, affecting every client.. How do I use this "PHP Settings" page correctly... or is it broken?
 
Good question. I have checked the following path: /usr/local/directadmin/data/templates/custom/

And I have this:

Code:
|?PHP_VER=54|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp/:/var/tmp/:/opt/alt/php`PHP1_RELEASE`/usr/share/pear/:/dev/urandom:/usr/local/php`PHP_VER`/lib/:`ACTIVE_USR_LOCAL_PHP_LIB`:/usr/local/lib/php/|
|?EMAIL=`USER`@`DOMAIN`|

|CUSTOM1|

[|USER|]
user = $pool
group = $pool

listen = /usr/local/php|PHP_VER|/sockets/$pool.sock
listen.owner = $pool
listen.group = |SERVER_GROUP|
listen.mode = 660

pm = dynamic
pm.max_children = 30
pm.start_servers = 5
pm.min_spare_servers = 2
pm.max_spare_servers = 5
pm.max_requests = 100

php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f |EMAIL|

|*if PHP_SESSION_SAVE_PATH!=""|
php_admin_value[session.save_path] = |PHP_SESSION_SAVE_PATH|
|*endif|

|*if OPEN_BASEDIR="ON"|
php_admin_value[open_basedir] = |OPEN_BASEDIR_PATH|
|*endif|
|*if PHP_MAIL_LOG_ENABLED="1"|
php_admin_value[mail.log] = |PHP_MAIL_LOG_DIR|/php-mail.log
|*endif|

|*if LIMIT_EXTENSIONS!=""|
security.limit_extensions = |LIMIT_EXTENSIONS|
|*endif|


|CUSTOM2|
 
There is no entry here for the values which I am trying to change. So I would have assumed that this doesn't affect the other values?
 
It's most likely the reason :) It's missing |FPM_PHP_SETTINGS| before |CUSTOM2|
 
So, I added that to the custom config file, but sadly, still doesn't seem to have resolved it.

Code:
|?PHP_VER=54|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp/:/var/tmp/:/opt/alt/php`PHP1_RELEASE`/usr/share/pear/:/dev/urandom:/usr/local/php`PHP_VER`/lib/:`ACTIVE_USR_LOCAL_PHP_LIB`:/usr/local/lib/php/|
|?EMAIL=`USER`@`DOMAIN`|

|CUSTOM1|

[|USER|]
user = $pool
group = $pool

listen = /usr/local/php|PHP_VER|/sockets/$pool.sock
listen.owner = $pool
listen.group = |SERVER_GROUP|
listen.mode = 660

pm = dynamic
pm.max_children = 30
pm.start_servers = 5
pm.min_spare_servers = 2
pm.max_spare_servers = 5
pm.max_requests = 100

php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f |EMAIL|

|*if PHP_SESSION_SAVE_PATH!=""|
php_admin_value[session.save_path] = |PHP_SESSION_SAVE_PATH|
|*endif|

|*if OPEN_BASEDIR="ON"|
php_admin_value[open_basedir] = |OPEN_BASEDIR_PATH|
|*endif|
|*if PHP_MAIL_LOG_ENABLED="1"|
php_admin_value[mail.log] = |PHP_MAIL_LOG_DIR|/php-mail.log
|*endif|

|*if LIMIT_EXTENSIONS!=""|
security.limit_extensions = |LIMIT_EXTENSIONS|
|*endif|

|FPM_PHP_SETTINGS|
|CUSTOM2|
 
So, I added that to the custom config file, but sadly, still doesn't seem to have resolved it.

Code:
|?PHP_VER=54|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp/:/var/tmp/:/opt/alt/php`PHP1_RELEASE`/usr/share/pear/:/dev/urandom:/usr/local/php`PHP_VER`/lib/:`ACTIVE_USR_LOCAL_PHP_LIB`:/usr/local/lib/php/|
|?EMAIL=`USER`@`DOMAIN`|

|CUSTOM1|

[|USER|]
user = $pool
group = $pool

listen = /usr/local/php|PHP_VER|/sockets/$pool.sock
listen.owner = $pool
listen.group = |SERVER_GROUP|
listen.mode = 660

pm = dynamic
pm.max_children = 30
pm.start_servers = 5
pm.min_spare_servers = 2
pm.max_spare_servers = 5
pm.max_requests = 100

php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f |EMAIL|

|*if PHP_SESSION_SAVE_PATH!=""|
php_admin_value[session.save_path] = |PHP_SESSION_SAVE_PATH|
|*endif|

|*if OPEN_BASEDIR="ON"|
php_admin_value[open_basedir] = |OPEN_BASEDIR_PATH|
|*endif|
|*if PHP_MAIL_LOG_ENABLED="1"|
php_admin_value[mail.log] = |PHP_MAIL_LOG_DIR|/php-mail.log
|*endif|

|*if LIMIT_EXTENSIONS!=""|
security.limit_extensions = |LIMIT_EXTENSIONS|
|*endif|

|FPM_PHP_SETTINGS|
|CUSTOM2|
Config rewrite needs to be run to re-generate configs from template.
 
Okay! That worked :)... So here's the follow-up question.

If a user changes these options by themselves, how will they take affect, unless I manually run
./build rewrite_confs ?

I feel that any user should be able to change these settings (especially as they're in the "User" section), but then they should automatically apply, let's say, after 5 mins or something?

Or now that I have added the missing line, will it just take affect anyway?.. As in, it's no longer necessary to run ./build rewrite_confs now that I have fixed the custom config file?
 
It should work normally now and PHP settings should shouldn’t take more than a minute to be set.
 
Back
Top