• 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

You are welcome! ;-)

Do "chown DOMAINUSER:psaserv /var/www/vhosts/DOMAINNAME/cgi-bin/"
Guess it will work then!
 
Last edited:
Nops, it did not work.. :-(
p.s: Does it require to reconfigure ("httpdmng --reconfigure-domain") the domain?
 
well ... mhhhh ... as for /var/www/vhosts/DOMAINNAME/cgi-bin/.cgi_wrapper/.phpwrapper
Is the first line "#!/bin/sh" only missing in your post or on your server too?

If yes - try adding it and check again.

As of "httpdmng --reconfigure-domain" <-- should only be necessary when you change vhost.conf or other "Plesk related" things for this domain
 
You pointed out exactly the right thing.. #!/bin/sh was there but without "#".. I added it.. reset the permissions.. and YESSSSS... its working..

Thanks man, I could never figure out that little diamond.
 
How i can compile php with additional .ini files (Scan this dir for additional .ini f

How i can compile php with additional .ini files (Scan this dir for additional .ini file) ?

i try this

./configure '--with-libdir=lib64' '--cache-file=../config.cache' '--prefix=/usr/local/php549-cgi' '--with-config-file-path=/usr/local/php549-cgi/etc' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-freetype-dir=/usr/local/php549-cgi' '--with-png-dir=/usr/local/php549-cgi' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr/local/php549-cgi' '--with-openssl' '--with-pspell' '--with-pcre-regex' '--with-zlib' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx' '--with-kerberos' '--with-unixODBC=/usr' '--enable-shmop' '--enable-calendar' '--without-sqlite3' '--with-libxml-dir=/usr/local/php549-cgi' '--enable-pcntl' '--with-imap' '--with-imap-ssl' '--enable-mbstring' '--enable-mbregex' '--with-gd' '--enable-bcmath' '--with-xmlrpc' '--with-ldap' '--with-ldap-sasl' '--with-mysql=/usr' '--with-mysqli' '--with-snmp' '--enable-soap' '--with-xsl' '--enable-xmlreader' '--enable-xmlwriter' '--enable-pdo' '--with-pdo-mysql' '--with-pdo-pgsql' '--with-pear=/usr/local/php549-cgi/pear' '--with-mcrypt' '--enable-intl' '--without-pdo-sqlite' '--with-t1lib=/usr' '--with-layout=GNU' '--with-mhash' '--with-config-file-path=/usr/local/php549-cgi/etc/php.ini' '--with-config-file-scan-dir=/usr/local/php549-cgi/etc/php.d/'

But no effect for /usr/local/php549-cgi/etc/php.d/

I would like to try to get almost the same php compiler than native plesk compiler for php.

I try to modifiy max_input_var but it doesn't works.

I see it had for php native plesk compiler :
- Server API Apache 2.0 Handler
Configuration File (php.ini) Path /etc
Loaded Configuration File /etc/php.ini
Scan this dir for additional .ini files /etc/php.d

For my configuration i get :
Server API CGI/FastCGI
Configuration File (php.ini) Path /usr/local/php549-cgi/etc/php.ini
Loaded Configuration File /usr/local/php549-cgi/etc/php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
 
Hello. I'm trying to run the site on a version of php 4.4.9. I do everything exactly according to the instructions, but when you open the site gives an error 504.
Maybe it's because of the lack file php449-cgi/bin/php-cgi?
In this folder, I have only: pear, peardev, pecl, php, phpize.
I am sorry for my English.
 
Hi,

I've been trying for hours now to get both PHP version working together. I've followed the howto in this article and related kb article, I've double checked, crosschecked, overchecked all the files and permissions again and again, but it still does not work. a phpinfo file still shows 5.3.3. I'm stuck and exhausted after a whole night trying to make it work.

I'm not very exhaustive in my message, but I've tried all what is said here, and sometimes elsewhere. And no way. Also, I can't find anyway to troubleshoot this sh#t

the suexec_log just shows

Code:
[2012-12-08 06:55:40]: uid: (10005/mydomainuser) gid: (508/508) cmd: cgi_wrapper

and error_log shows some error messages related to the damn obsolete typo3 version not working with php 5.3.

Whatever I do, phpinfo still shows PHP 5.3 executed on that website.

How can I further troubleshoot ? Why is PHP 5.3 still executed on that website and not php 5.2.17 ?

I'm rolling back to old plesk with old php for the time beeing, but I'll need to find a way to make it work.
 
Last edited:
Hi,

I have retried today, after some sleep. seems a little bit better as I get now in suexec_log:

[2012-12-08 17:57:58]: uid: (10014/domuser) gid: (508/508) cmd: .phpwrapper

I guess it means it executes the wrapper as exepected.

I also get an SElinux error (it is on permissive, so that's not the blocker) about /usr/local/php52-cgi/bin/php-cgi

Meaning, php 5.2.17 is executed.

but then, I get the Premature end of script headers: phpinfo.php error.

And I don't find why. How can I troubleshoot this ? any help very welcome.
 
Last edited:
Well.... Looks like nobody care anymore about this.

I do ;)
However I have not yet found a solution, only some more testing scenario's.


Look in this thread:

http://forum.parallels.com/showthread.php?p=666454#post666454


and try the following:


mv /var/www/cgi-bin/cgi_wrapper/cgi_wrapper{,.bak}
vi /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
#!/bin/sh
export PHP_FCGI_CHILDREN=4
export PHP_FCGI_MAX_REQUESTS=1000
exec /usr/local/php540-cgi/bin/php-cgi
chmod $(stat -c %a /var/www/cgi-bin/cgi_wrapper/cgi_wrapper.bak) /var/www/cgi-bin/cgi_wrapper/cgi_wrapper

echo "<?php phpinfo(); ?>" > /var/www/vhosts/<domain>/httpdocs/phpinfo.php
mv /var/www/vhosts/<domain>/conf/vhost.conf{,.bak}
rm -f /var/www/vhosts/<domain>/conf/*httpd*.include
/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain <domain>
service httpd restart


Now open your browser, and go to http://<domain>/phpinfo.php


In my case, it worked and gave me
PHP Version 5.4.0

But this is global, and therefore is not a solution,
it is however a proof of concept, that the PHP version has no issues.


When using the wrapper in /var/www/vhosts/<domain>/cgi-bin/.cgi_wrapper/.phpwrapper
my /var/log/httpd/suexec_log logs nothing..
 
i finally ran this code

'./configure' '--build=x86_64-unknown-linux-gnu' '--host=x86_64-unknown-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--with-libdir=lib64' '--cache-file=../config.cache' '--prefix=/usr/local/bin/php52-cgi' '--with-config-file-path=/usr/local/bin/php52-cgi/etc' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-freetype-dir=/usr/local/bin/php52-cgi' '--with-png-dir=/usr/local/bin/php52-cgi' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr/local/bin/php52-cgi' '--with-openssl' '--with-pspell' '--with-pcre-regex' '--with-zlib' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx' '--with-kerberos' '--with-unixODBC=/usr' '--enable-shmop' '--enable-calendar' '--with-libxml-dir=/usr/local/bin/php52-cgi' '--enable-pcntl' '--with-imap' '--with-imap-ssl' '--enable-mbstring' '--enable-mbregex' '--with-gd' '--enable-bcmath' '--with-xmlrpc' '--with-ldap' '--with-ldap-sasl' '--with-mysql=/usr' '--with-mysqli' '--with-snmp' '--enable-soap' '--with-xsl' '--enable-xmlreader' '--enable-xmlwriter' '--enable-pdo' '--with-pdo-mysql' '--with-pdo-pgsql' '--with-pear=/usr/local/bin/php52-cgi/pear' '--with-mcrypt' '--without-pdo-sqlite' '--without-unixODBC' '--enable-force-cgi-redirect' '--enable-fastcgi' '--with-config-file-scan-dir=/usr/local/bin/php52-cgi/php.d'

it went but i had an error
creating cache ../config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-redhat-linux-gnu
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

anyone familiar with this error? -- configure: error: no acceptable cc found in $PATH
 
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

anyone familiar with this error? -- configure: error: no acceptable cc found in $PATH

Guess this would be far beyond the scope of this Thread. For compiling PHP a *bit advanced* Linux knowledge is needed - and no offense - your Question unfortunately shows that you are lacking this knowledge!

Meaning of this Error: There is no Compiler installed on your Machine - you can't compile Code without Compiler ...

In general: This Thread should be used if you got Problems implementing other PHP Versions into your Plesk Server. It's not about "How do I compile PHP for dummies" ;-)
Problems about compiling PHP should be asked in the appropriate PHP Boards / Mailing Lists.

Andreas
 
@Superkikim: Did you manage to get it running? If not - please answer all the Questions (directory/file permissions, ...) I asked the others in this Thread and post it here - then I will have a look.
 
"chown DOMAINUSER:psaserv /var/www/vhosts/DOMAINNAME/cgi-bin/"

Worked for me,
it was set to psacln group. (cant recall why)


Thank you futureweb!
 
Guess this would be far beyond the scope of this Thread. For compiling PHP a *bit advanced* Linux knowledge is needed - and no offense - your Question unfortunately shows that you are lacking this knowledge!

Meaning of this Error: There is no Compiler installed on your Machine - you can't compile Code without Compiler ...

In general: This Thread should be used if you got Problems implementing other PHP Versions into your Plesk Server. It's not about "How do I compile PHP for dummies" ;-)
Problems about compiling PHP should be asked in the appropriate PHP Boards / Mailing Lists.

Andreas

i take no offense in that, am just a little bit "rusty". Anyway I got everything installed, but when I checked the PHP version I get Internal Server Error from the domain. Check the error log files and got 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

anyone had this error before?
 
i take no offense in that, am just a little bit "rusty". Anyway I got everything installed, but when I checked the PHP version I get Internal Server Error from the domain. Check the error log files and got 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

anyone had this error before?

alright - good to hear you managed to compile PHP! :)
as I told the others - please answer the Questions (dir/file permissions/owner, ...) I asked in my earlier posts - then I will have a look.

Andreas Schnederle-Wagner
 
alright - good to hear you managed to compile PHP! :)
as I told the others - please answer the Questions (dir/file permissions/owner, ...) I asked in my earlier posts - then I will have a look.

Andreas Schnederle-Wagner


Hi here's what I have


# 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 20:34 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 20:19 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



# ll -a /var/www/vhosts/domain.org/cgi-bin/
total 16
drwxr-x--- 4 domainuser psaserv 4096 Jan 14 20:24 .
drwxr-xr-x 20 root root 4096 Jan 14 20:19 ..
d--x-----x 2 root root 4096 Jan 14 20:26 .cgi_wrapper
drwxr-xr-x 2 domainuser psacln 4096 Jan 14 20:19 test



# cat /var/www/vhosts/domain.org/cgi-bin/.cgi_wrapper/.phpwrapper
#!/bin/sh
export PHPRC=/var/www/vhosts/domain.org/etc/
export PHP_FCGI_CHILDREN=4
export PHP_FCGI_MAX_REQUESTS=1000
exec /usr/local/bin/php52-cgi/bin/php-cgi



# cat /var/www/vhosts/domain.org/conf/vhost.conf
<Directory /var/www/vhosts/domain.org/httpdocs>
RemoveHandler fcgid-script
<IfModule mod_fcgid.c>
AddHandler fcgid-script .php
<Files ~ (\.php)>
SetHandler fcgid-script
FCGIWrapper /var/www/vhosts/domain.org/cgi-bin/.cgi_wrapper/.phpwrapper .php
Options +ExecCGI
allow from all
</Files>
</IfModule>
</Directory>
 
Back
Top