Currently any request to a PHP file on my server regardless of domain returns HTTP 503 error. my system is setup to use apache to connect to PHP through php-fpm (the default shipped with directadmin)
The template file for directadmin for php-fpm is this:
/usr/local/directadmin/data/templates/php-fpm.conf
and its contents are:
And for HTTP to connect to PHP-FPM, its template file is:
/usr/local/directadmin/data/templates/user_virtual_host.conf
and the contents are:
When DirectAdmin generated the scripts and PHP 8.2 is selected, the line in HTTPD configuration is this:
And generated php-fpm config for the user is:
I tried changing directadmin from the current channel to the stable channel and I had no luck.
Have I spotted a bug that the directadmin devs don't know about?
and why would the value of PHP_FPM_SOCKET_PATH contain 1004 and point to path where the live sockets are not present?
The template file for directadmin for php-fpm is this:
/usr/local/directadmin/data/templates/php-fpm.conf
and its contents are:
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`|
|?MAX_CHILDREN=`MAX_CHILDREN_DEFAULT`|
|?MAX_REQUESTS=500|
|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 = ondemand
pm.max_children = |MAX_CHILDREN|
pm.process_idle_timeout = 20
pm.max_requests = |MAX_REQUESTS|
security.limit_extensions = .php .inc .phtml
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f |EMAIL|
|*if PHP_SESSION_SAVE_PATH!=""|
php_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|
|FPM_PHP_SETTINGS|
|CUSTOM2|
And for HTTP to connect to PHP-FPM, its template file is:
/usr/local/directadmin/data/templates/user_virtual_host.conf
and the contents are:
Code:
|*if PHP="OFF"|
|?HAVE_PHP1_FPM=0|
|*endif|
|?OBDP1=|
|*if PHP1_RELEASE!="0"|
|?OBDP1=:/usr/local/php`PHP1_RELEASE`/lib/php/|
|*endif|
|?OBDP2=|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/opt/alt/php`PHP1_RELEASE`/usr/share/pear/:/dev/urandom:/usr/local/lib/php/`OBDP1`|
|?FASTCGI_OPENBASEDIR=|
|*if OPEN_BASEDIR_ENABLED="ON"|
|?FASTCGI_OPENBASEDIR=-d open_basedir="`OPEN_BASEDIR_PATH`"|
|*endif|
|?PHP_MAIL_LOG=|
|?CLI_PHP_MAIL_LOG=|
|*if PHP_MAIL_LOG_ENABLED="1"|
|?PHP_MAIL_LOG=-d mail.log="`PHP_MAIL_LOG_DIR`/php-mail.log"|
|?CLI_PHP_MAIL_LOG=php_admin_value mail.log `PHP_MAIL_LOG_DIR`/php-mail.log|
|*endif|
|?PHP_EMAIL=`USER`@`DEFAULT_DOMAIN`|
|?FASTCGI_SENDMAIL_FROM=-d sendmail_from="`PHP_EMAIL`"|
<Directory "|HOME|/public_html">
|*if HAVE_PHP1_FPM="1"|
<FilesMatch "\.(php|inc|phtml)$">
AddHandler "proxy:unix:|PHP_FPM_SOCKET_PATH||fcgi://localhost" .inc .php .phtml
</FilesMatch>
<FilesMatch "\.(php53|php54|php55|php56|php70|php71|php72|php73|php74|php80|php81|php82)$">
Order Allow,Deny
Deny from all
</FilesMatch>
|*endif|
|*if HAVE_SUEXEC_PER_DIR="1"|
<IfModule mod_fcgid.c>
SuexecUserGroup |USER| |GROUP|
</IfModule>
|*endif|
|*if HAVE_PHP1_FCGI="1"|
<IfModule mod_fcgid.c>
<FilesMatch "\.php$">
SetHandler fcgid-script
FCGIWrapper '/usr/local/safe-bin/fcgid|PHP1_RELEASE|.sh /usr/local/directadmin/data/users/|USER|/php/|DEFAULT_DOMAIN|.ini |FASTCGI_SENDMAIL_FROM| |FASTCGI_OPENBASEDIR||FASTCGI_PHP_SETTINGS| |PHP_MAIL_LOG|' .php
Options +ExecCGI
</FilesMatch>
<FilesMatch "\.(php53|php54|php55|php56|php70|php71|php72|php73|php74|php80|php81|php82)$">
Order Allow,Deny
Deny from all
</FilesMatch>
</IfModule>
|*endif|
|IF_MODULE_LITESPEED_OPEN|
|*if USER_CLI="1"|
php_admin_flag engine |PHP|
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |PHP_EMAIL|'
|CLI_PHP_MAIL_LOG|
|CLI_PHP_SETTINGS|
|*endif|
|*if OPEN_BASEDIR_AND_CLI="ON"|
php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|IF_MODULE_LITESPEED_CLOSE|
</Directory>
When DirectAdmin generated the scripts and PHP 8.2 is selected, the line in HTTPD configuration is this:
Code:
AddHandler "proxy:unix:/run/php-fpm/php82-1004.sock|fcgi://localhost" .inc .php .phtml
And generated php-fpm config for the user is:
Code:
listen = /usr/local/php82/sockets/$pool.sock
I tried changing directadmin from the current channel to the stable channel and I had no luck.
Have I spotted a bug that the directadmin devs don't know about?
and why would the value of PHP_FPM_SOCKET_PATH contain 1004 and point to path where the live sockets are not present?