Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not included in the server configuration

JohnnyBravo

Verified User
Joined
Aug 24, 2018
Messages
37
Does anyone knows how to get rid of this error?

After ./build rewrite_confs this error shows up:

Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not included in the server configuration

After ./build php everything is working fine....

But after another ./build rewrite_confs this error shows up again...
 
Hi,

#PHP Settings
php1_release=8.0
php1_mode=mod_php
php2_release=no
php2_mode=php-fpm
php_ini=no
php_timezone=Europe/Amsterdam
php_ini_type=production
x_mail_header=yes

And this:

#WEB Server Settings
webserver=nginx_apache
modsecurity=no
modsecurity_ruleset=owasp
apache_ver=2.4
apache_mpm=auto
mod_ruid2=yes <- maybe this is the problem??
harden_symlinks_patch=yes
use_hostname_for_alias=yes
redirect_host=server.domain.com (editted by me)
redirect_host_https=yes
 
OK, and what are the steps to take?

./build update
./build set mod_ruid2 no
./build set php1_mode php-fpm
./build rewrite_confs
 
No, it's not an OS specific. PHP extensions were moved into a separate file for a while ago and commands to install them changed. Docs are outdated in regarding this.
 
No, it's not an OS specific. PHP extensions were moved into a separate file for a while ago and commands to install them changed. Docs are outdated in regarding this.
I see it's also possible to install Opcache with this method: ./build set_php opcache yes
Is it possible to combine opcache with php-fpm?
 
And is it possible to combine opcache with php-fpm?

Yes, it is. Run ./build to see all possibilities. As of extensions it includes now:

Code:
 | Install/update PHP extensions:                            |
 |    ./build php_gmp                                        |
 |    ./build php_igbinary                                   |
 |    ./build php_ioncube                                    |
 |    ./build php_imagick                                    |
 |    ./build php_imap                                       |
 |    ./build php_ldap                                       |
 |    ./build php_opcache                                    |
 |    ./build php_phalcon                                    |
 |    ./build php_psr                                        |
 |    ./build php_redis                                      |
 |    ./build php_readline                                   |
 |    ./build php_snuffleupagus                              |
 |    ./build php_suhosin                                    |
 |    ./build php_xmlrpc                                     |
 |    ./build php_zend                                       |
 
Is it possible to combine opcache with php-fpm?
For sure as you can see from @zEitEr's reply. We also have it running with all of our php-fpm versions.
You can even optimize the values for php opcache if needed per php-fpm version.

For example in /usr/local/phpXX/lib/php.conf.d create a 99-custom.ini file and put values in like this:
Code:
opcache.memory_consumption=256
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=24000
opcache.revalidate_freq=48

Replace phpXX with the php version you want to adjust this for.
Be aware! The values mentioned are example values.

In another post @zEitEr posted to this which may also be interesting to use:
 
opcache.memory_consumption=256
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=24000
opcache.revalidate_freq=48[/code]

We have this. Buffers doubled, max_accelerated_files should be a primenumber (if it isnt, it takes the next lower primenumber), enable_file_override to allow overwriting from cached files if cache goes full, and have an eye on revalidate_freq - we set it to 0 as our customers are working with cms and they become crazy, if they change some wordpress article, and must wait 48 seconds. Zero is revalidation/refresh everytime. It takes a litte from the performance, but guarantees calm users.

Code:
opcache.memory_consumption=256
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=32531
opcache.revalidate_freq=0
opcache.enable_cli=1
opcache.validate_permission=1
opcache.use_cwd=1
opcache.revalidate_path=1
opcache.enable_file_override=1


 
It takes a litte from the performance, but guarantees calm users.
Most of these you don't need in the 99-directadmin.ini because directadmin already uses these values as defaults.

In the /usr/local/directadmin/custombuild/configure/opcache/opcache.ini these are already present:
Code:
opcache.revalidate_freq=0
opcache.enable_cli=1
opcache.validate_permission=1
opcache.use_cwd=1
opcache.revalidate_path=1
opcache.enable_file_override=1

So these are also in the 10-directadmin.ini file.
 
Back
Top