• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Two PHP versions linux Plesk HOWTO

alright - first I see is that "/var/www/vhosts/domain.org/cgi-bin/.cgi_wrapper" got the wrong user/group ...
And what user/group does this file have? --> "/var/www/vhosts/domain.org/cgi-bin/.cgi_wrapper/.phpwrapper" <-- guess it's root:root too as the main directory?
 
alright - first I see is that "/var/www/vhosts/domain.org/cgi-bin/.cgi_wrapper" got the wrong user/group ...
And what user/group does this file have? --> "/var/www/vhosts/domain.org/cgi-bin/.cgi_wrapper/.phpwrapper" <-- guess it's root:root too as the main directory?

I did a chown yesterday

-r-x------ 1 domainuser psaserv 161 Jan 14 20:26 /var/www/vhosts/domain.org/cgi-bin/.cgi_wrapper/.phpwrapper

[root@vps-1121582-14368 ~]# ll -a /var/www/vhosts/domain.org
total 80
drwxr-xr-x 20 root root 4096 Jan 14 20:19 .
drwxr-xr-x 19 root root 4096 Jan 14 20:19 ..
drwxr-x--- 5 domainuser psaserv 4096 Jan 14 20:19 anon_ftp
drwxr-xr-x 2 root root 4096 Jan 14 20:19 bin
drwxr-x--- 4 domainuser psaserv 4096 Jan 14 20:24 cgi-bin
drwxr-x--- 2 root psaserv 4096 Jan 14 21:02 conf
drwxr-xr-x 2 root root 4096 Jan 14 20:19 dev
drwxr-xr-x 2 root psaserv 4096 Jan 14 20:19 error_docs
drwxr-xr-x 2 root root 4096 Jan 14 20:19 etc
drwxr-x--- 7 domainuser psaserv 4096 Jan 14 20:37 httpdocs
drwxr-xr-x 2 root root 4096 Jan 14 20:19 lib
drwxr-xr-x 2 root root 4096 Jan 14 20:19 lib64
drwxr-x--- 2 root psaserv 4096 Jan 14 21:02 pd
drwx------ 2 domainuser root 4096 Jan 14 20:19 private
dr-xr-x--- 7 domainuser psaserv 4096 Jan 14 20:19 statistics
drwxr-xr-x 2 root psaserv 4096 Jan 14 20:19 subdomains
drwxrwxrwt 2 root root 4096 Jan 14 20:19 tmp
drwxr-xr-x 4 root root 4096 Jan 14 20:19 usr
drwxr-xr-x 3 root root 4096 Jan 14 20:19 var
drwxr-xr-x 2 root psaserv 4096 Jan 14 20:19 web_users
 
/var/www/vhosts/domain.org/cgi-bin/.cgi_wrapper and /var/www/vhosts/domain.org/cgi-bin/.cgi_wrapper/.phpwrapper got right user/group now?

ok - what error you excactly get?
php cgi is working correct?
 
btw) .cgi_wrapper got wrong group ... I would suggest to re-read the how-to and follow every step EXACTLY!
 
/var/www/vhosts/domain.org/cgi-bin/.cgi_wrapper and /var/www/vhosts/domain.org/cgi-bin/.cgi_wrapper/.phpwrapper got right user/group now?

ok - what error you excactly get?
php cgi is working correct?


# ./php-cgi -v
PHP 5.2.17 (cgi-fcgi) (built: Jan 12 2013 09:52:58)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies

error is this

[Sat Jan 12 15:27:05 2013] [warn] [client xxx.xxx.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Sat Jan 12 15:27:05 2013] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers: index.php
 
btw) .cgi_wrapper got wrong group ... I would suggest to re-read the how-to and follow every step EXACTLY!

i followed this

# chown domainuser:psaserv .cgi_wrapper -R

when I do this now

# chown domainuser:psacln .cgi_wrapper -R
chown: changing ownership of `.cgi_wrapper/.phpwrapper': Operation not permitted
chown: changing ownership of `.cgi_wrapper': Operation not permitted

and am logon as root
 
in the first posting in this Thread and in the KB it's clearly stated what you should do:

# cd /var/www/vhosts/domain.com/cgi-bin
# chmod 101 .cgi_wrapper
# chmod 500 .cgi_wrapper/.phpwrapper
# chown domain.com:psacln .cgi_wrapper -R
# chattr -R +i .cgi_wrapper

now you can't change it because of the i attrib. - remove it first - then change user/group and set the i attr again.

But I would suggest that you start over from scratch ... and follow all steps EXCACTLY ...
 
chattr -R -i .cgi_wrapper

chattr +i makes a file immutable aka unchangeable, even by root.
It is part of the extended attributes of ext2-3-4, and highly useful.
 
The only thing that needs to be added to the guide for Plesk 10/11 is:
chown <user>:psaserv /var/www/vhosts/domain.com/cgi-bin

The following packages are required for compilation of the switches in this guide (only tested on CentOS 5.8):

yum install -y gcc gcc-c++ cpp kernel-headers.x86_64 libxml2-devel openssl-devel bzip2-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel openldap-devel mysql-devel postgresql-devel aspell-devel net-snmp-devel libxslt-devel make libc-client-devel libicu-devel gmp-devel curl-devel libmcrypt-devel unixODBC-devel


but as futureweb stated before, if you don't know how to compile yourself, you're not going to get very far.
 
Last edited:
@IgorG: as StéphanS said - maybe you should update the KB Article to reflect this necessary change in Plesk 11 - already some ppl stumbled across this! ;-)
@Igor Smitran: maybe you could add a note to the inital posting too?

Andreas Schnederle-Wagner
 
Do you mean mentioned chown command? Could you please clarify a little bit - as which point it should be added in KB?
 
The Problem is that with Plesk 11 the cgi-bin directory is owned by "psacln" and not "psaserv" (not sure why this change was done?!?!?)
But multiple PHP-Versions won't work if it's not psaserv ...

So I guess it should be added here:

# chgrp psaserv /var/www/vhosts/domain.com/cgi-bin
# cd /var/www/vhosts/domain.com/cgi-bin
# chmod 101 .cgi_wrapper
# chmod 500 .cgi_wrapper/.phpwrapper
# chown domain.com:psacln .cgi_wrapper -R
# chattr -R +i .cgi_wrapper

Andreas Schnederle-Wagner
 
guess this should work! ;-)

But you also could just publish the "new version" with the chgrp ... in older Plesk Versions the Directory is already owned by psaserv - so if you execute this command nothing changes / nothing happens ... maybe a bit less confusing (as people often won't read exactly what's written in the KB and just blindly copy/paste every *command* they find ... ! ;-))
 
I can confirm that cgi-bin in users homedir on Plesk 10.2.0 is also owned by group psacln.
So this also needs a chgrp.

Edit: as suggested by futureweb, chgrp can be used on all Plesk 9+ installs.
For those that are already configured to have cgi-bin on psaserv group there will be no impact.
And it makes the guide more straightforward.

Also @IgorG can you ask the dev team why this is the only directory in the users homedir that is not owned by group psaserv?
 
Last edited:
Back
Top