1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

Question How to compile custom additional PHP version with Thread Safety enabled on Plesk Onyx

Discussion in 'Plesk Onyx for Linux' started by Edvinas, May 10, 2017.

  1. Edvinas

    Edvinas New Pleskian

    1
    20%
    Joined:
    May 10, 2017
    Messages:
    2
    Likes Received:
    0
    Location:
    United Kingdom
    Hi Everyone,
    i'm experiencing a problem with php versions that come out of the box with Plesk Onyx 17.5.3. The problem i have that all php versions out of the box are compiled with "Thread Safety" disabled and i want to enable it as it is required for php pthreads module. Is there any way i can do that on plesk onyx?

    I have compiled an additional php-7.0.18 to
    /opt/plesk/php/7.0-TS/

    using this configuration
    ./configure --prefix=/opt/plesk/php/7.0-TS --bindir=/opt/plesk/php/7.0-TS/bin --sbindir=/opt/plesk/php/7.0-TS/sbin --libexecdir=/opt/plesk/php/7.0-TS/lib64 --datadir=/opt/plesk/php/7.0-TS/share --sysconfdir=/opt/plesk/php/7.0-TS/etc --sharedstatedir=/opt/plesk/php/7.0-TS/com --localstatedir=/opt/plesk/php/7.0-TS/var --libdir=/opt/plesk/php/7.0-TS/lib64 --includedir=/opt/plesk/php/7.0-TS/include --infodir=/opt/plesk/php/7.0-TS/share/info --mandir=/opt/plesk/php/7.0-TS/share/man --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --with-libdir=lib64 --cache-file=../config.cache --with-config-file-path=/opt/plesk/php/7.0-TS/etc --with-config-file-scan-dir=/opt/plesk/php/7.0-TS/etc/php.d --disable-debug --with-pear=/opt/plesk/php/7.0-TS/share/pear/ --with-pic --disable-rpath --with-bz2 --with-freetype-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-pcre-regex --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --with-kerberos --enable-calendar --with-libxml-dir=/usr --enable-xml --enable-phpdbg --with-enchant=shared,/usr --with-litespeed --enable-fpm --with-fpm-acl --without-gd --disable-dom --disable-dba --without-unixODBC --disable-pdo --disable-xmlreader --disable-xmlwriter --without-sqlite3 --disable-phar --disable-fileinfo --disable-json --without-pspell --disable-wddx --without-curl --disable-posix --disable-sysvmsg --disable-sysvshm --disable-sysvsem --with-fpm-systemd build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu --enable-maintainer-zts --enable-soap=shared --enable-cgi

    make -j4
    make -j4 install

    added php handler to plesk for php-fpm
    plesk bin php_handler --add -displayname "7.0 Thread Safety" -path /opt/plesk/php/7.0-TS/sbin/php-fpm -clipath /opt/plesk/php/7.0-TS/bin/php -phpini /opt/plesk/php/7.0-TS/etc/php.ini -type fpm -service php70-TS-fpm -poold /opt/plesk/php/7.0-TS/etc/php-fpm.d/ -id custom-php70-ts-fpm

    added php handler to plesk for php-fastcgi
    plesk bin php_handler --add -displayname "7.0.18 Thread Safety" -path /opt/plesk/php/7.0-TS/bin/php-cgi -clipath /opt/plesk/php/7.0-TS/bin/php -phpini /opt/plesk/php/7.0-TS/etc/php.ini -type fastcgi -id custom-php70-ts-fastcgi

    server is responding with a status of 503 (Service Unavailable)
    at this point i'm able to pick installed additional php version from plesk for each of the domains however I'm missing something and as soon as i pick newly installed php either fpm or fastcgi the server is responding with a status of 503 (Service Unavailable)

    php error_log

    [proxy:error] [pid 9965:tid 139787540027136] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/www/vhosts/system/example.com/php-fpm.sock (*) failed

    [proxy_fcgi:error] [pid 9965:tid 139787540027136] [client x.x.x.x:z] AH01079: failed to make connection to backend: httpd-UDS



    Can somebody advice how do i troubleshoot this? and maybe share command line code on how to compile additional php for Plesk Onyx 17.5.3 from source

     
  2. IgorG

    IgorG Forums Analyst Staff Member

    45
    84%
    Joined:
    Oct 27, 2009
    Messages:
    23,952
    Likes Received:
    1,088
    Location:
    Novosibirsk, Russia
    Affiliate:
    https://plesk.com/?a_aid=59ae552b0731c
    First of all, make sure that plesk-php70-fpm service is up and running.
    Also, make sure that you have no any additional parameters enabled in /etc/php-fpm.d/www.conf
     
  3. Edvinas

    Edvinas New Pleskian

    1
    20%
    Joined:
    May 10, 2017
    Messages:
    2
    Likes Received:
    0
    Location:
    United Kingdom
    there is no additional parameters in /etc/php-fpm.d/www.conf
    i have checked /etc/php-fpm.d/www.conf content is:
    # Default www-pool configuration has been disabled by Plesk Panel.
    # Pool configuration was saved in '/etc/php-fpm.d/www.conf.saved_by_psa'.

    there is no www.conf in /opt/plesk/php/7.0-TS/etc/php-fpm.d/ however there is www.conf.default

    also /opt/plesk/php/7.0-TS/etc/php-fpm.d/example.com.conf file is not generated per domain basis if i switch to newly installed php



    also did you mean php70-TS-fpm service ? as that is what i named service when adding additional php handler:
    plesk bin php_handler --add -displayname "7.0 Thread Safety" -path /opt/plesk/php/7.0-TS/sbin/php-fpm -clipath /opt/plesk/php/7.0-TS/bin/php -phpini /opt/plesk/php/7.0-TS/etc/php.ini -type fpm -service php70-TS-fpm -poold /opt/plesk/php/7.0-TS/etc/php-fpm.d/ -id custom-php70-ts-fpm

    I have checked both services:

    # service php70-TS-fpm status
    Redirecting to /bin/systemctl status php70-TS-fpm.service
    Unit php70-TS-fpm.service could not be found.


    # service plesk-php70-fpm status
    Redirecting to /bin/systemctl status plesk-php70-fpm.service
    ● plesk-php70-fpm.service - The PHP 7.0.18 FastCGI Process Manager
    Loaded: loaded (/usr/lib/systemd/system/plesk-php70-fpm.service; disabled; vendor preset: disabled)
    Active: inactive (dead)

    May 10 13:20:50 localhost systemd[1]: Starting The PHP 7.0.18 FastCGI Process Manager...
    May 10 13:20:51 localhost systemd[1]: Started The PHP 7.0.18 FastCGI Process Manager.
    May 10 14:42:56 localhost systemd[1]: Stopping The PHP 7.0.18 FastCGI Process Manager...
    May 10 14:42:56 localhost systemd[1]: Stopped The PHP 7.0.18 FastCGI Process Manager.
    May 10 14:45:47 localhost systemd[1]: Starting The PHP 7.0.18 FastCGI Process Manager...
    May 10 14:45:47 localhost systemd[1]: Started The PHP 7.0.18 FastCGI Process Manager.
    May 12 09:34:28 localhost systemd[1]: Stopping The PHP 7.0.18 FastCGI Process Manager...
    May 12 09:34:28 localhost systemd[1]: Stopped The PHP 7.0.18 FastCGI Process Manager.




    Here is all of my php handlers

    # plesk bin php_handler --list

    id: display name: full version: version: type: cgi-bin: php-cli: php.ini: custom: status:

    ced43060130bf0dab5cb69616db02c70b074fb2e 7.0.18 Thread Safety 7.0.18 7.0 fastcgi /opt/plesk/php/7.0-TS/bin/php-cgi /opt/plesk/php/7.0-TS/bin/php /opt/plesk/php/7.0-TS/etc/php.ini true disabled

    cgi 5.4.16 by OS vendor 5.5.38 5.5 cgi /usr/bin/php-cgi /usr/bin/php /etc/php.ini false disabled

    custom-php70-ts-fastcgi 7.0.18 Thread Safety 7.0.18 7.0 fastcgi /opt/plesk/php/7.0-TS/bin/php-cgi /opt/plesk/php/7.0-TS/bin/php /opt/plesk/php/7.0-TS/etc/php.ini true enabled
    custom-php70-ts-fpm 7.0.18 Thread Safety 7.0.18 7.0 fpm /opt/plesk/php/7.0-TS/sbin/php-fpm /opt/plesk/php/7.0-TS/bin/php /opt/plesk/php/7.0-TS/etc/php.ini true enabled

    fastcgi 5.4.16 by OS vendor 5.5.38 5.5 fastcgi /usr/bin/php-cgi /usr/bin/php /etc/php.ini false enabled
    fpm 5.4.16 by OS vendor 5.5.38 5.5 fpm /usr/sbin/php-fpm /usr/bin/php /etc/php.ini false enabled
    module 5.4.16 by OS vendor 5.5.38 5.5 module /usr/bin/php-cgi /usr/bin/php /etc/php.ini false disabled

    plesk-php55-cgi 5.5.38 5.5.38 5.5 cgi /opt/plesk/php/5.5/bin/php-cgi /opt/plesk/php/5.5/bin/php /opt/plesk/php/5.5/etc/php.ini true disabled
    plesk-php55-fastcgi 5.5.38 5.5.38 5.5 fastcgi /opt/plesk/php/5.5/bin/php-cgi /opt/plesk/php/5.5/bin/php /opt/plesk/php/5.5/etc/php.ini true enabled
    plesk-php55-fpm 5.5.38 5.5.38 5.5 fpm /opt/plesk/php/5.5/sbin/php-fpm /opt/plesk/php/5.5/bin/php /opt/plesk/php/5.5/etc/php.ini true enabled

    plesk-php56-cgi 5.6.30 5.6.30 5.6 cgi /opt/plesk/php/5.6/bin/php-cgi /opt/plesk/php/5.6/bin/php /opt/plesk/php/5.6/etc/php.ini true disabled
    plesk-php56-fastcgi 5.6.30 5.6.30 5.6 fastcgi /opt/plesk/php/5.6/bin/php-cgi /opt/plesk/php/5.6/bin/php /opt/plesk/php/5.6/etc/php.ini true enabled
    plesk-php56-fpm 5.6.30 5.6.30 5.6 fpm /opt/plesk/php/5.6/sbin/php-fpm /opt/plesk/php/5.6/bin/php /opt/plesk/php/5.6/etc/php.ini true enabled

    plesk-php70-cgi 7.0.18 7.0.18 7.0 cgi /opt/plesk/php/7.0/bin/php-cgi /opt/plesk/php/7.0/bin/php /opt/plesk/php/7.0/etc/php.ini true disabled
    plesk-php70-fastcgi 7.0.18 7.0.18 7.0 fastcgi /opt/plesk/php/7.0/bin/php-cgi /opt/plesk/php/7.0/bin/php /opt/plesk/php/7.0/etc/php.ini true enabled
    plesk-php70-fpm 7.0.18 7.0.18 7.0 fpm /opt/plesk/php/7.0/sbin/php-fpm /opt/plesk/php/7.0/bin/php /opt/plesk/php/7.0/etc/php.ini true enabled

    plesk-php71-cgi 7.1.4 7.1.4 7.1 cgi /opt/plesk/php/7.1/bin/php-cgi /opt/plesk/php/7.1/bin/php /opt/plesk/php/7.1/etc/php.ini true disabled
    plesk-php71-fastcgi 7.1.4 7.1.4 7.1 fastcgi /opt/plesk/php/7.1/bin/php-cgi /opt/plesk/php/7.1/bin/php /opt/plesk/php/7.1/etc/php.ini true enabled
    plesk-php71-fpm 7.1.4 7.1.4 7.1 fpm /opt/plesk/php/7.1/sbin/php-fpm /opt/plesk/php/7.1/bin/php /opt/plesk/php/7.1/etc/php.ini true enabled


    if i switch php version to "7.0.18 Thread Safety" on the example.com domain /var/www/vhosts/system/example.com/php-fpm.sock file disappears:
    /var/www/vhosts/system/example.com/php-fpm.sock disappears

    /var/www/vhosts/example.com/logs/error_log shows 2 errors:
    [proxy:error] [pid 52862:tid 139955131737856] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/www/vhosts/system/example.com/php-fpm.sock (*) failed
    [proxy_fcgi:error] [pid 52862:tid 139955131737856] [client x.x.x.x:port] AH01079: failed to make connection to backend: httpd-UDS

    # ps aux | grep fpm
    root 938 0.0 0.0 491748 20716 ? Ss May10 0:11 php-fpm: master process (/opt/plesk/php/5.5/etc/php-fpm.conf)
    root 944 0.0 0.1 506528 33304 ? Ss May10 0:02 sw-engine-fpm: master process (/etc/sw-engine/sw-engine-fpm.conf)
    root 51594 0.0 0.0 126276 1680 pts/0 T 09:24 0:00 vi /etc/php-fpm.d/www.conf
    root 56290 0.0 0.0 126468 1972 pts/0 T 09:57 0:00 vi /opt/plesk/php/7.0-TS/etc/php-fpm.d/www.conf.default
    root 56291 0.0 0.0 126300 1860 pts/0 T 09:57 0:00 vi /opt/plesk/php/7.0-TS/etc/php-fpm.d/www.conf
    root 56304 0.0 0.0 126476 2028 pts/0 T 09:58 0:00 vi /opt/plesk/php/7.0-TS/etc/php-fpm.d/www.conf.default
    root 58605 0.0 0.0 126456 1864 pts/0 T 10:17 0:00 vi /etc/sw-engine/sw-engine-fpm.conf
    psaadm 58646 2.7 0.2 528292 68604 ? S 10:18 0:00 sw-engine-fpm: pool plesk
    enekros+ 59086 6.8 0.1 514312 37280 ? S 10:18 0:00 php-fpm: pool example1.com
    blacksw+ 59115 14.7 0.2 540124 62528 ? S 10:18 0:00 php-fpm: pool example2.co.uk
    root 59118 0.0 0.0 112652 960 pts/0 S+ 10:18 0:00 grep --color=auto fpm

    looks like php-fpm: master process (/opt/plesk/php/7.0-TS/etc/php-fpm.conf) is not running as it is not appearing in the list above

    Any suggestions what should i do next?
     
Loading...