FastCGI May Be Necessary for Wordpress sites to function, having difficulty finding it

apple58

Verified User
Joined
Dec 31, 2021
Messages
22
I am having some difficulty using a Wordpress site on a server with the DA GUI installed. The problem is that when I try to update the plugins through WP, it asks me for ftp credentials. This issue can be caused by one of two things: incorrect permissions, which is not the issue (I fully checked this), or the fastCGI module for apache is missing. I have since verified that it is missing, using the apache show module command (it is not in the list). I have performed other tests as well, including using a phpinfo.php file to check if the module is running.

So, I found a DA forum post that tells how to fix this error, through the command line, for DA using custombuild 2.0: https://forum.directadmin.com/threads/howto-mod_fcgid-in-cb-2-0-switchable-to-suphp.45386/ . My server, which has been newly fully updated, is only running version 1 of CustomBuild. I used the commands to check this on the server.

So, when I tried to follow the instructions in that post, I kept getting errors. The errors that I was getting are as follows:
cd /usr/local/src
[root@server src]# wget http://mirrors.issp.co.th/apache/httpd/mod_fcgid/mod_fcgid-2.3.7.tar.bz2
--2022-01-12 15:18:38-- http://mirrors.issp.co.th/apache/httpd/mod_fcgid/mod_fcgid-2.3.7.tar.bz2
Resolving mirrors.issp.co.th (mirrors.issp.co.th)... failed: Name or service not known.
wget: unable to resolve host address ‘mirrors.issp.co.th’
[root@server src]# tar xjf mod_fcgid-2.3.7.tar.bz2
tar (child): mod_fcgid-2.3.7.tar.bz2: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

I have tried several different methods to install the missing module and allow it to run, and each of them fails in a similar way. This was a fresh install of what was the latest version of DA, so I am confused that it doesn't have the latest version of CB. T

I tried this on a forum recommending use of the command line for centos 8: https://www.linode.com/docs/guides/how-to-install-and-configure-fastcgi-and-php-fpm-on-centos-8/


which also failed, and here for updating on a server using almalinux8. https://neutroncloud.in/docs/how-to-install-php-fpm-for-nginx-on-almalinux/ upon getting to step 5, it says the file cannot be found. I am running AlmaLinux, but this problem was occurring before I converted from Centos 8.

Can someone please provide instruction for enabling or installing this plugin, through the command line or through the interface, to fix this issue? It needs to be the correct one for this version of CustomBuild. Or perhaps there is a way to toggle to a higher version of Custombuild? Any assistance is appreciated. Thanks!
 
Just for short. There is a much easier solution. Just use php-fpm for your php versions and you don't have this problem because then you don't need the fastcgi mod.

My server, which has been newly fully updated, is only running version 1 of CustomBuild.
Custombuild or custombuild plugin? That are 2 different things.

What kind of php versions and mods are you running at the moment?
 
At the moment, I was running php 7.4, which is active. The mods are what is preinstalled with the software. I got a list on the command line, and they are:

Loaded Modules:
core_module (static)
authn_file_module (static)
authn_dbm_module (static)
authn_anon_module (static)
authn_dbd_module (static)
authn_socache_module (static)
authn_core_module (static)
authz_host_module (static)
authz_groupfile_module (static)
authz_user_module (static)
authz_dbm_module (static)
authz_owner_module (static)
authz_dbd_module (static)
authz_core_module (static)
access_compat_module (static)
auth_basic_module (static)
auth_form_module (static)
auth_digest_module (static)
allowmethods_module (static)
file_cache_module (static)
cache_module (static)
cache_disk_module (static)
cache_socache_module (static)
socache_shmcb_module (static)
socache_dbm_module (static)
socache_memcache_module (static)
socache_redis_module (static)
so_module (static)
watchdog_module (static)
macro_module (static)
dbd_module (static)
dumpio_module (static)
buffer_module (static)
ratelimit_module (static)
reqtimeout_module (static)
ext_filter_module (static)
request_module (static)
include_module (static)
filter_module (static)
substitute_module (static)
sed_module (static)
deflate_module (static)
http_module (static)
mime_module (static)
log_config_module (static)
log_debug_module (static)
logio_module (static)
env_module (static)
expires_module (static)
headers_module (static)
unique_id_module (static)
setenvif_module (static)
version_module (static)
remoteip_module (static)
proxy_module (static)
proxy_connect_module (static)
proxy_ftp_module (static)
proxy_http_module (static)
proxy_fcgi_module (static)
proxy_scgi_module (static)
proxy_uwsgi_module (static)
proxy_fdpass_module (static)
proxy_wstunnel_module (static)
proxy_ajp_module (static)
proxy_balancer_module (static)
proxy_express_module (static)
proxy_hcheck_module (static)
session_module (static)
session_cookie_module (static)
session_dbd_module (static)
slotmem_shm_module (static)
ssl_module (static)
http2_module (static)
lbmethod_byrequests_module (static)
lbmethod_bytraffic_module (static)
lbmethod_bybusyness_module (static)
lbmethod_heartbeat_module (static)
unixd_module (static)
systemd_module (static)
dav_module (static)
status_module (static)
autoindex_module (static)
info_module (static)
suexec_module (static)
cgi_module (static)
dav_fs_module (static)
dav_lock_module (static)
vhost_alias_module (static)
negotiation_module (static)
dir_module (static)
actions_module (static)
speling_module (static)
userdir_module (static)
alias_module (static)
rewrite_module (static)
mpm_event_module (shared)
 
At the moment, I was running php 7.4, which is active.
But that does not answer all the questions I made, but I see I was confusing.
With mods I ment modules, so like php 7.4 but with mod_ruid2 and mod_php or php-fpm or how? Is that the only php running?

And also the custombuild question if that was the plugin you were talking about or custombuild itself.
 
I installed the Custombuild plugin, because the post I had referenced above states that this plugin is necessary to install fastCGI. The only problem I am having (that is causing this problem) is that when I try to do the auto-update on a Wordpress site, it requests FTP credentials. On WP boards, I found that this was due to a fastcgi mod missing. I will try the guide again.

As far as the modules, what would be the correct command line that I can give you the output of?

I think I only have one version of php active on this server but I can check on that. The list I gave you was the output for apache modules only. Thanks again.
 
states that this plugin is necessary to install fastCGI.
No it's not. That's why I talked about it. It states that it needs Custombuild 2.0, which is the system, not the plugin. ;) Those are 2 different things.
However, all new installations have custombuild 2.0 by default so that should be fine unless this server is already running for many years and not using custombuild 2.0.

WP-boards are wrong. We have several Wordpress sites on several servers, and we can click the automatic update from within Wordpress which runs without any issues. It never asks for credentials.
So this might be caused by the php_mod used.

As far as the modules, what would be the correct command line that I can give you the output of?
It's not a command, but you can check like this via SSH:
Code:
cd /usr/local/directadmin/custombuild
less options.conf

You should see something liket his, which is what I need:

#PHP Settings
php1_release=7.4
php1_mode=php-fpm
php2_release=no
php2_mode=php-fpm
php3_release=no
php3_mode=php-fpm
php4_release=no
php4_mode=php-fpm

and a bit lower:
mod_ruid2=
and I need to know if this is set to yes or no.
 
Hi Richard,

This is the output from the command you provided:

php1_release=7.4
php1_mode=php-fpm
php2_release=no
php2_mode=php-fpm
php3_release=no
php3_mode=php-fpm
php4_release=no
php4_mode=php-fpm
secure_php=no
php_ini=no
php_timezone=UTC
php_ini_type=production
x_mail_header=yes

#MySQL Settings
mysql=8.0
mariadb=10.4
mysql_inst=mariadb
mysql_backup=yes
mysql_backup_gzip=no
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups
mysql_force_compile=no


I don't see the mod_ruid in the list. Is there a module then that is missing?
 
I don't see the mod_ruid in the list. Is there a module then that is missing?
No, it defaults to no, so if that line is not present it should be ok.

Lets look at the output of the command Erulezz gave you.

Can you check the disabled_functions line in your php.ini? Probably it's empty but want to know for sure.
You should be able to find it at /usr/local/php74/lib/php.ini if all is well.
 
I'm not sure why I didn't see this before, but it was set to no:

webserver=apache
http_methods=ALL
litespeed_serialno=trial
modsecurity=no
modsecurity_ruleset=owasp
apache_ver=2.4
apache_mpm=auto
mod_ruid2=no
userdir_access=no
harden_symlinks_patch=yes
use_hostname_for_alias=no
redirect_host=server.take-ur-vites.org
redirect_host_https=no

#WEB Applications Settings
phpmyadmin=yes
phpmyadmin_public=yes
phpmyadmin_ver=5
squirrelmail=no
roundcube=yes
webapps_inbox_prefix=no

#Cronjob Settings
cron=yes
cron_frequency=daily
email=[email protected]
notifications=no
da_autoupdate=no
updates=no
webapps_updates=no

#CloudLinux Settings
cloudlinux=no
cloudlinux_beta=no
cagefs=no

#Advanced Settings
csf=no
curl=no
ssl_configuration=intermediate

#PHP extensions can be found in php_extensions.conf
redis=no
 
Output of the command provided by Erulezz:

2.0.0 (rev: 2830)

In the php.ini file, I did CTRL-F and typed in disabled_functions and it does not exist in the file. Thanks!
 
disabled_functions and it does not exist in the file
Hmmz... I made a typo, should be disable_functions so without the d at the end of disable.

Maybe this is causing the issue that wordpress is asking for FTP connection.
Any reason not to use this? Or did you install it via the package manager (yum) already?

If you didn't install it yet, you could give that one a try.
Code:
cd /usr/local/directadmin/custombuild
./build set curl yes
./build update
./build curl

After that try to see if now the WP update works without asking FTP credentials.

P.s. are you using another firewall than csf? Or did you install csf manually? Just curiosity.
 
Hi, thank you for all of your help. Unfortunately, this did not fix the issue. I installed curl, and then ran the same commands as above, to see if curl was set to yes, and it is set to yes. But on two wordpress sites, the update buttons still ask for ftp credentials. Is there something else that it could be? Thanks!
 
The php.ini disable_functions is
disable_functions = exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
 
The topic you found about mod_ruid2 is very old and that method is not used anymore. So this won't cause the issue and won't be helpfull.

At this moment I'm out of idea's, I don't know if your attempts to use fcgi already messed something up.
Or that it's some local issue (for example .htaccess limits or firewall plugin of wordpress) with the sites themselfs.

Can other WP sites update without issues?
 
I have installed two different wordpress sites on this same server, on different user accounts. I have tried to do the updates on both of them, which were previously working on the old servers.

When you say ownership, I am not sure what you mean? The permissions are set to 755 for that folder as well as the wp-content internal directory. Thanks!
 
As far as htaccess issues, I deleted the old htaccess file, went into wordpress and created a new htaccess file from the program automatically. Thanks!
 
Back
Top