Jump to content

PHP 7.1 - PHP-FPM and Caching on WHM/cPanel


Recommended Posts

Posted

I had been using PHP 5.3 for some time and since 4.1.19 had a suggestion about upgrading to a higher PHP version, I started upgrading things to be able to upgrade to highest version available.

First I upgraded to EasyApache4, then to PHP 7.1 . At first I thought everthing was working fine till I realised that Opcache was not

I realised that PHP 7.1 did not have a DSO handler option and Opcache was not supported on suexec and cgi. Googling a bit I found that PHP-FPM was mostly used and recommended and found a way to switch to it. Although I have seen some articles telling it was possible to make Opcache work with PHP-FPM I could not manage it.

Now I am running multiple PHP and using PHP 5.6.30 with Opcache on my production site, PHP 7.1 with PHP-FPM on my test site.

What I am wondering ;

Can I use a caching method on PHP 7.1 with PHP-FPM ?

Which is better ? 

  • PHP 5.6.30 + Opcache ?
  • PHP 7.1 + PHP-FPM  ?

 

 

 

  • Replies 64
  • Created
  • Last Reply
Posted
1 hour ago, ABGenc said:

I had been using PHP 5.3 for some time and since 4.1.19 had a suggestion about upgrading to a higher PHP version, I started upgrading things to be able to upgrade to highest version available.

First I upgraded to EasyApache4, then to PHP 7.1 . At first I thought everthing was working fine till I realised that Opcache was not

I realised that PHP 7.1 did not have a DSO handler option and Opcache was not supported on suexec and cgi. Googling a bit I found that PHP-FPM was mostly used and recommended and found a way to switch to it. Although I have seen some articles telling it was possible to make Opcache work with PHP-FPM I could not manage it.

Now I am running multiple PHP and using PHP 5.6.30 with Opcache on my production site, PHP 7.1 with PHP-FPM on my test site.

What I am wondering ;

Can I use a caching method on PHP 7.1 with PHP-FPM ?

Which is better ? 

  • PHP 5.6.30 + Opcache ?
  • PHP 7.1 + PHP-FPM  ?

 

 

 

You can use the DSO handler with 7.1. But the DSO handler requires a MPM that's preforked and the DSO module can only work with one version of PHP at a time. So you will have to choose which version you want to install. 

For example, if you want to install it for PHP7, you will need to navigate to the PHP Extension page in EA4, and search for the following:

ea-php70-php   (DSO is not in the title)

Once installed, it will become available in the PHP Handler page: WHM: Home »Software »MultiPHP Manager -> PHP Handler

 

Personally I want to use the MPM_event handler and hence I can't use DSO and hereby OpCache at the moment. Once I've got a bit more time I will find the solution and I can post it here :).

Posted

Thanks for the information @inkredible. I am holding to switch to 7.1 cause I found a problem with profile links causing HTTP 500 error on my server. Working with Support to solve or find the root cause. Once it is solved I can try this and probably move all of the sites to 7.1 + DSO + Opcache.

What do you think ?

7.1 + DSO + Opcache or 7.1 + PHP-FPM ?

Posted
Just now, ABGenc said:

Thanks for the information @inkredible. I am holding to switch to 7.1 cause I found a problem with profiles creating HTTP 500 error on my server. Working with Support to solve or find the root cause. Once it is solved I can try this and probably move all of the sites to 7.1 + DSO + Opcache.

What do you think ?

7.1 + DSO + Opcache or 7.1 + PHP-FPM ?

I am using 7.1 for a couple months without issues on IPB already. I recommend you to do a system check (in ACP) once switched to 7.1, most likely you forgot to add the PHP extensions like mbstring or so. The system check will certainly tell you what's missing.

I can't judge what is better, but once I've got some more time I will dig into it :-).

Posted
14 minutes ago, inkredible said:

I am using 7.1 for a couple months without issues on IPB already. I recommend you to do a system check (in ACP) once switched to 7.1, most likely you forgot to add the PHP extensions like mbstring or so. The system check will certainly tell you what's missing.

I can't judge what is better, but once I've got some more time I will dig into it :-).

System Check all green except for the following information ;

      You do not have the cURL PHP extension loaded or it is running a version less than 7.36. Enabling the cURL module provides a more efficient and reliable library for making connections from your website to other websites.

Posted
6 minutes ago, ABGenc said:

System Check all green except for the following information ;

      You do not have the cURL PHP extension loaded or it is running a version less than 7.36. Enabling the cURL module provides a more efficient and reliable library for making connections from your website to other websites.

Ok then that's not the issue. You could check the php error log yourself if you don't want to wait for the support. The log will most likely tell you what's misisng. As of the curl extension : Cpanel is about to ship an updated curl version. You can already install the prerelease package (for me it worked without issues): https://features.cpanel.net/topic/update-curl-for-easyapache-4-and-cloudlinux-6-8

Posted
3 minutes ago, inkredible said:

Ok then that's not the issue. You could check the php error log yourself if you don't want to wait for the support. The log will most likely tell you what's misisng. As of the curl extension : Cpanel is about to ship an updated curl version. You can already install the prerelease package (for me it worked without issues): https://features.cpanel.net/topic/update-curl-for-easyapache-4-and-cloudlinux-6-8

Good to know there are others using WHM/cPanel ;) Thanks for the info :) 

Posted
Just now, ABGenc said:

Good to know there are others using WHM/cPanel ;) Thanks for the info :) 

Yeah maybe we can actually find a group of WHM/Cpanel + IPS users. I think most of us have the same requirements (aka just a few, big and selfowned sites hosted with CPanel) which might be helpful sometimes (for example when it comes to optimizations for the servers).

Posted
8 minutes ago, inkredible said:

Yeah maybe we can actually find a group of WHM/Cpanel + IPS users. I think most of us have the same requirements (aka just a few, big and selfowned sites hosted with CPanel) which might be helpful sometimes (for example when it comes to optimizations for the servers).

Or even create one :) I am not an expert but trying to improve myself. I will be glad to help anyone who needs if I can save his/her time.

That was the main reason I put WHM/cPanel on my topics related to this subject, to create an awareness ;)

Posted

What is the optimal EA4 PHP 7.1 configuration?

I was change my Easy Apache 4 from 7.0.16 to php 7.1.2 now and enable almost everything in php extension. 

My board works very good, but my other site was not working with 7.1 so I switch php version in cpanel to 7.0 for this domain. Now everything working as It should.  

Posted
2 hours ago, inkredible said:

Ok then that's not the issue. You could check the php error log yourself if you don't want to wait for the support. The log will most likely tell you what's misisng. As of the curl extension : Cpanel is about to ship an updated curl version. You can already install the prerelease package (for me it worked without issues): https://features.cpanel.net/topic/update-curl-for-easyapache-4-and-cloudlinux-6-8

Seems membermap's previous version was causing the problem with following error

[21-Mar-2017 11:06:09 UTC] PHP Fatal error:  Cannot use lexical variable $k as a parameter name in /home/mzdclbtr/public_html/applications/membermap/sources/Map/Map.php on line 386

[21-Mar-2017 11:06:09 UTC] PHP Fatal error:  Cannot use lexical variable $k as a parameter name in /home/mzdclbtr/public_html/applications/membermap/sources/Map/Map.php on line 386

Test site fixed but now having difficulty upgrading membermap to latets version with following error :(

1C133/9 The application you uploaded cannot be installed because it is not a valid application, the archive is corrupt or the file and directory permissions in /applications do not allow it.

Posted
3 hours ago, ABGenc said:

Thanks for the information @inkredible. I am holding to switch to 7.1 cause I found a problem with profile links causing HTTP 500 error on my server. Working with Support to solve or find the root cause. Once it is solved I can try this and probably move all of the sites to 7.1 + DSO + Opcache.

What do you think ?

7.1 + DSO + Opcache or 7.1 + PHP-FPM ?

I have contacted our server administrator (he's freelancing for us, but he's a fulltime server administrator). He said that our setup to use MPM event, PHP-FPM and Opcache is decent and works. You have to enable PHP-FPM domain by domain in your MultiPHP Manager. With phpinfo() you can check whether everything is running as intended.

 

41 minutes ago, jcdesign said:

What is the optimal EA4 PHP 7.1 configuration?

I was change my Easy Apache 4 from 7.0.16 to php 7.1.2 now and enable almost everything in php extension. 

My board works very good, but my other site was not working with 7.1 so I switch php version in cpanel to 7.0 for this domain. Now everything working as It should.  

I doubt that enabling every extension is the optimal configuration. I have only enabled the necessary/needed extensions. I have noticed the biggest performance improvement after installing/switching to OpCache + PHP-FPM + MPM_Event.

Posted
1 minute ago, inkredible said:

I have contacted our server administrator (he's freelancing for us, but he's a fulltime server administrator). He said that our setup to use MPM event, PHP-FPM and Opcache is decent and works. You have to enable PHP-FPM domain by domain in your MultiPHP Manager. With phpinfo() you can check whether everything is running as intended.

What is the extension name for MPM Event ?

Note : On my last try I have learned that multiphp manager and how to enable PHP-FPM ;) 

Posted
3 minutes ago, ABGenc said:

What is the extension name for MPM Event ?

Note : On my last try I have learned that multiphp manager and how to enable PHP-FPM ;) 

It's not a PHP extension, it's Apache's Multi Process Manager (MPM). You can chose it when customizing your Apache build with EA4 (first step).

Edit: How many concurrent users (Live users at analytics) do you have to serve?

Posted
1 minute ago, inkredible said:

It's not a PHP extension, it's Apache's Multi Process Manager (MPM). You can chose it when customizing your Apache build with EA4 (first step).

Edit: How many concurrent users (Live users at analytics) do you have to serve?

It gets to a peak of 50 users sometimes.

@inkredible I think this what you mention

mod_mpm_event

2.4.25-5.5.1.cpanel

Threaded event Multi-Processing Module for Apache HTTP Server

 

mod_mpm_event is disabled but  mod_mpm_prefork is installed

Posted
2 hours ago, jcdesign said:

What is the optimal EA4 PHP 7.1 configuration?

I was change my Easy Apache 4 from 7.0.16 to php 7.1.2 now and enable almost everything in php extension. 

My board works very good, but my other site was not working with 7.1 so I switch php version in cpanel to 7.0 for this domain. Now everything working as It should.  

For the beginning the optimal configuration would be anything meeting the following requirements

Quote

PHP Requirements

    PHP version 7.1.2.
    fsockopen function available
    Multibyte String extension loaded
    DOM extension loaded
    GD extension loaded
    MySQLi extension loaded
    OpenSSL extension loaded
    Session extension loaded
    SimpleXML extension loaded
    XML extension loaded
    XMLReader extension loaded
    XMLWriter extension loaded
    Phar extension loaded
    Zip extension loaded
    Exif extension loaded
    256 MB memory limit.

File System Requirements

    /public_html/applications is writable
    /public_html/datastore is writable
    /public_html/plugins is writable
    /public_html/uploads is writable
    /public_html/uploads/logs is writable

MySQL Requirements

    MySQL version 5.5.5-10.1.22-MariaDB.

Recommendations

    You do not have the cURL PHP extension loaded or it is running a version less than 7.36. Enabling the cURL module provides a more efficient and reliable library for making connections from your website to other websites.

Here is my review list on EasyApache4 , current profile. ( I have removed all php 5.6 extensions ) . I hope @inkredible can advice what is to be added or removed from this list for his optimal config ( MPM event, PHP-FPM and Opcache )

apache24
apr
apr-util
config
config-runtime
cpanel-tools
documentroot
mod_asis
mod_authn_anon
mod_authn_socache
mod_bwlimited
mod_cgi
mod_deflate
mod_env
mod_expires
mod_headers
mod_mpm_prefork
mod_proxy
mod_proxy_fcgi
mod_proxy_http
mod_ssl
mod_suexec
mod_suphp
mod_version
php-cli
php-cli-lsphp
php71
php71-libc-client
php71-pear
php71-php-bcmath
php71-php-calendar
php71-php-cli
php71-php-common
php71-php-curl
php71-php-devel
php71-php-exif
php71-php-fileinfo
php71-php-fpm
php71-php-ftp
php71-php-gd
php71-php-gettext
php71-php-iconv
php71-php-imap
php71-php-litespeed
php71-php-mbstring
php71-php-mysqlnd
php71-php-opcache
php71-php-pdo
php71-php-pgsql
php71-php-posix
php71-php-sockets
php71-php-xml
php71-php-zip
php71-runtime
profiles-cpanel
tools 

 

Posted
2 hours ago, ABGenc said:

It gets to a peak of 50 users sometimes.

@inkredible I think this what you mention

mod_mpm_event

2.4.25-5.5.1.cpanel

Threaded event Multi-Processing Module for Apache HTTP Server

 

mod_mpm_event is disabled but  mod_mpm_prefork is installed

Yes that's what I mean.

I can just tell you what I have experienced and what our server administrator recommends for our use case. Depending on what you are hosting/doing you may have different requirements / other optimal setups. Also I am not THE expert, I just have been responsible for two quite big forums. Our largest peak has been 2.8k concurrent users according to analytics (more than 160k unique visitors on one day).

I can't tell you what modules you can uninstall, nor could I just send you my list probably as we require some extra modules which are not needed by IPS (for instance we need PDO while IPS uses mysqli afaik). As far as I know @Charles is responsible for the server infrastructure here at IPS and he's the one who could tell you what PHP extensions are needed.

Edit: @ABGenc do you experience any issues at the moment or are you just trying to optimize things? With that setup your forum should run quite fast. The biggest optimizations which has been necessary when we experienced our large peaks have been the apache configuration and mysql configuration. The default CPanel/WHM configuration started struggling when we first hit 200-300 live users I think.

Posted
3 minutes ago, inkredible said:

Edit: @ABGenc do you experience any issues at the moment or are you just trying to optimize things? With that setup your forum should run quite fast. The biggest optimizations which has been necessary when we experienced our large peaks have been the apache configuration and mysql configuration. The default CPanel/WHM configuration started struggling when we first hit 200-300 live users I think.

Things are quite fine at the moment. Just trying to optimize and get things sorted and updated. Willing to settle on ;

PHP 7.1, MaridDB 10.1 ( done ) , All tables InnoDB

I believe a minimum PHP extensions list would be a good topic too where ppl could extend it according to their needs as you told.

Posted
16 minutes ago, ASTRAPI said:

One month is a lot for stability tests ...

A second version may come out at such long period....

They said they are going to keep it updated from now on ;).

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...