Koozali.org: home of the SME Server

Obsolete Releases => SME 9.x Contribs => Topic started by: calisun on May 03, 2019, 09:52:18 AM

Title: PHP-SCL Versions and upload limits
Post by: calisun on May 03, 2019, 09:52:18 AM
I am using contrib PHP-SCL Versions since default PHP is 5.3.3 and Wordpress requires 5.6.2
I have pointed contrib to my iBay and everything works fine, except for upload limits.

I was issuing following command to increase PHP limits:

Code: [Select]
  db configuration setprop php MemoryLimit 128M
  db configuration setprop php PostMaxSize 112M
  db configuration setprop php UploadMaxFilesize 96M
  expand-template /etc/php.ini
  sv t httpd-e-smith

Afterwards I have realized that above command works on default PHP install, not on contribs.

Does anybody know how I can increase memory limits for the contrib?
Title: Re: PHP-SCL Versions and upload limits
Post by: mmccarn on May 03, 2019, 01:32:01 PM
The php-scl versions use different db settings - https://wiki.contribs.org/PHP_Software_Collections#Usage

From that wiki page, for php56 you would need to use:
Code: [Select]
db configuration setprop php56 MemoryLimit 128M
db configuration setprop php56 PostMaxSize 112M
db configuration setprop php56 UploadMaxFilesize 96M
signal-event php-update
Title: Re: PHP-SCL Versions and upload limits
Post by: calisun on May 10, 2019, 12:18:37 AM
Thank you mmccarn, it worked perfectly.
I have updated my Wordpress How-To, to help other users.
Title: Re: PHP-SCL Versions and upload limits
Post by: mmccarn on May 10, 2019, 04:44:30 AM
I have created a feature request against the php-scl contrib to default to the primary 'php' configuration values if there are no specific values indicated for a given php version: Bug 10774 - NFR -Use 'php' config values when there are no specific php-scl settings configured  (https://bugs.contribs.org/show_bug.cgi?id=10774)
Title: Re: PHP-SCL Versions and upload limits
Post by: ReetP on May 10, 2019, 10:48:09 AM
Please note PHP 5.6 and 7.0 are EOL and should not be used.

The minimum SCL version is 7.1 and that is in security maintenance mode now.

I have added that to the wiki

https://wiki.contribs.org/PHP_Software_Collections
Title: Re: PHP-SCL Versions and upload limits
Post by: calisun on June 01, 2019, 04:06:13 AM
Another related question,
how about other PHP specific code that is found in step A2 in: https://wiki.contribs.org/Wordpress_Multisite
Will that also work on PHP-SCL or some other code needs to be issued for PHP-SCL to function properly?
Title: Re: PHP-SCL Versions and upload limits
Post by: mmccarn on June 01, 2019, 12:58:54 PM
Another related question,
how about other PHP specific code that is found in step A2 in: https://wiki.contribs.org/Wordpress_Multisite
Will that also work on PHP-SCL or some other code needs to be issued for PHP-SCL to function properly?

The db variable from step A2 (https://wiki.contribs.org/Wordpress_Multisite#A.29_Wordpress_install_in_an_iBay_of_SME_server:) (PHPBaseDir) only appears in one  template:
Quote from: etc/httpd/conf/httpd.conf/95AddType00PHP2ibays
{
    my $status = $php{status} || 'disabled';
    if ($status eq 'enabled')
    {
   use esmith::AccountsDB;
   my $adb = esmith::AccountsDB->open_ro();
   foreach my $ibay ($adb->ibays)
   {
       local $dynamicContent = $ibay->prop('CgiBin') || 'disabled';
       if ($dynamicContent eq 'enabled')
       {
      $OUT .= "\n<Directory /home/e-smith/files/ibays/" . $ibay->key . "/html>\n";
      $OUT .= "    AddType application/x-httpd-php .php .php3 .phtml\n";
      $OUT .= "    AddType application/x-httpd-php-source .phps\n";

      # Set the sandbox within which PHP is confined to play
      my $basedir = $ibay->prop('PHPBaseDir')
          || ("/home/e-smith/files/ibays/" . $ibay->key . "/");
      $OUT .= "    php_admin_value open_basedir $basedir\n";
      $OUT .= "</Directory>\n";
       }
   }
    }
}

The template only affects /etc/httpd/conf/httpd.conf.

My conclusion is that the setting for PHPBaseDir is unaffected by the php/phpscl version, and the existing instructions should work as expected.
Title: Re: PHP-SCL Versions and upload limits
Post by: ReetP on June 01, 2019, 01:34:58 PM
Note that PHP 5.6 is EoL with security updates ceasing 31st December 2018

PHP 7.0 is EoL too.

PHP 7.1 is EoL Dec 2019

PHP 7.2 is EoL Nov 2020

We should not be encouraging use of anything below 7.1 and prefererably 7.2

I'll try and take a look at Mikes NFR, but we should be looking at implementing it for newer versions of PHP.
Title: Re: PHP-SCL Versions and upload limits
Post by: calisun on June 03, 2019, 04:30:19 AM
We should not be encouraging use of anything below 7.1 and prefererably 7.2

Updated instructions for Wordpress_Multisite in step A7 and and Part2 step 3 to reflect this