Changes

From SME Server
Jump to navigationJump to search
291 bytes added ,  12:34, 24 September 2021
m
general tidy
Line 1: Line 1: −
Starting SME10 php module is not used anymore for httpd. Instead we rely on php-fpm for every available version of php.  
+
Starting with SME 10, the '''php''' module is no longer used for httpd. Instead we rely on '''php-fpm''' which can enable every available version of php.  
    
By default we provide the following versions:  
 
By default we provide the following versions:  
   −
* 54 (maintained by Red-Hat up to CentOS 7 EOL: 30 Jun 2024),
+
*54 (maintained by Red-Hat up to CentOS 7 EOL: 30 Jun 2024).
* 55,56,70,71,72 (unsupported),
+
*55,56,70,71,72 (Note: unsupported!).
* 73 (supported up to 6 Dec 2021),
+
*73 (supported up to 6 Dec 2021).
* 74 (supported up to 28 Nov 2022),
+
*74 (supported up to 28 Nov 2022).
* 80 (supported up to 26 Nov 2023).
+
*80 (supported up to 26 Nov 2023).
   −
===Available db keys to handle php configuration and services===
+
<br />
 +
===db keys available to control php configuration and services===
 
First you need to decide if you want to alter the php behaviour for an ibay or for a specific php version, of for all php versions.
 
First you need to decide if you want to alter the php behaviour for an ibay or for a specific php version, of for all php versions.
 
{| class="wikitable"
 
{| class="wikitable"
Line 46: Line 47:  
|customization of /etc/opt/remi/php80/php.ini
 
|customization of /etc/opt/remi/php80/php.ini
 
|}
 
|}
Every version of php has its own php-fpm service running, the related configuration db entry is php-fpm for php (ie php54), php55-php-fpm for php55 and so on. If you really want to disable one version of php, here what you need to do for php55 as an example:
+
Every version of php has its own php-fpm service running, the related configuration db entry is (as shown in the Table above) php-fpm for php (ie php54), php55-php-fpm for php55 and so on.
 +
 
 +
If you really want to disable one version of php, shown below is what you need to do for php55, as an example:
 
  config setprop php55-php-fpm status disabled
 
  config setprop php55-php-fpm status disabled
 
  signal-event webapps-update
 
  signal-event webapps-update
   −
=== Available properties ===
+
===Available properties===
 
Here is a list of available properties to configure php. You have to choose at which level you want to handle the change.  
 
Here is a list of available properties to configure php. You have to choose at which level you want to handle the change.  
   −
* Do you want the change for the whole server, then probably choose to change it for key php): db configuration setprop php ...
+
*Do you want the change for the whole server? -- then probably choose to change it for key php): db configuration setprop php ...
* Do you want the change for a specific version of php, then you should probably do it against a specific php key e.g. : db configuration setprop php74 ...
+
*Do you want the change for a specific version of php? -- then you should probably do it against a specific php key e.g. : db configuration setprop php74 ...
* Do you want to apply the change for a specific ibay, this is what we suggest you to do in most cases: db accounts setprop myibay ..
+
*Do you want to apply the change for a specific ibay? -- this is what we suggest you to do in most cases: db accounts setprop myibay ..
    
{| class="wikitable"
 
{| class="wikitable"
Line 209: Line 212:  
|
 
|
 
|}
 
|}
if you want to set a specific value for an ibay, here we use php80 for ibay MYIBAY and avoid to have any disabled function:
+
if you want to set a specific value for an ibay, here we show how to use php80 for ibay MYIBAY and avoid having any disabled function:
 
  db accounts setprop MYIBAY disable_functions none PHPVersion 80
 
  db accounts setprop MYIBAY disable_functions none PHPVersion 80
 
  signal-event webapps-update
 
  signal-event webapps-update
{{Note box|It is highly suggested to install smeserver-webhosting contrib to set your ibay php values from the server-manager. Everything is available and it prevent you from doing any mistake.}}
+
{{Note box|It is strongly suggested that you install the smeserver-webhosting contrib enabling you to set your ibay php values from the server-manager. Everything is available and it prevents you making a mistake in the settings.}}
    
===Display Error Messages===
 
===Display Error Messages===
   −
By default PHP does not display error messages on screen. Some times you get a blank page when executing PHP scripts. Usually some sort of error has occurred, but this error text will not be displayed as SME Server is configured to not display them. Instead the error messages are reported to the log files of the webserver and the general logfile of the server.  
+
By default PHP does not display error messages on screen. Sometimes you get a blank page when executing PHP scripts. Usually some sort of error has occurred, but this error text will '''not''' be displayed as SME Server is configured to not display them. Instead the error messages are reported to the log files of the webserver and the general logfile of the server.  
    
Try to analyze your logfiles:
 
Try to analyze your logfiles:
 
/var/log/httpd/error_log and /var/log/httpd/access_log and perhaps also /var/log/messages.
 
/var/log/httpd/error_log and /var/log/httpd/access_log and perhaps also /var/log/messages.
   −
{{Warning box|It is strongly advised to disable display errors after you have tracked and solved the problem, as the displayed error message might provide information (like filesystem layout) that only should be known to the system administrators and not to users, let alone people with bad intentions.}}
+
{{Warning box|It is strongly advised that you disable "display errors" after you have tracked and solved the problem, as the displayed error message might provide information (like filesystem layout) that only should be known to the system administrators and not to users, let alone people with bad intentions. Thus it is a potential SECURITY RISK. After debugging, disable it again.}}
    
====Enable changes for all php versions====
 
====Enable changes for all php versions====
Line 264: Line 267:  
  signal-event webapps-update
 
  signal-event webapps-update
 
===Open basedir restriction===
 
===Open basedir restriction===
SME Server has a security measure in place which is called 'open basedir restriction'. This measure prevents PHP from executing or invoking other PHP scripts outside the scope of it's own tree in other words it creates a 'sandbox' or 'jail'.
+
SME Server has a security measure in place which is called 'open basedir restriction'. This measure prevents PHP from executing or invoking other PHP scripts outside the scope of its own tree; in other words it creates a 'sandbox' or 'jail'.
 +
 
 
Overall configuration is defined in the php.ini file but you can add an override on a per ibay basis.
 
Overall configuration is defined in the php.ini file but you can add an override on a per ibay basis.
    
====Error message====
 
====Error message====
The PHP open basedir restriction usually present to the user like this in the /var/log/messages file:
+
The PHP open basedir restriction is usually presented to the user like this in the /var/log/messages file:
    
  Aug 12 17:27:42 homer httpd: PHP Warning:  main(): open_basedir restriction in effect. File(/tmp/test.php) is not within the allowed path(s): (/home/e-smith/files/ibays/Primary/html/) in /home/e-smith/files/ibays/Primary/html/test.php on line 2
 
  Aug 12 17:27:42 homer httpd: PHP Warning:  main(): open_basedir restriction in effect. File(/tmp/test.php) is not within the allowed path(s): (/home/e-smith/files/ibays/Primary/html/) in /home/e-smith/files/ibays/Primary/html/test.php on line 2
Line 298: Line 302:  
upload_tmp_dir
 
upload_tmp_dir
   −
From SME Server V8 up to SME Server V9, you could have sometime an error thrown by PHP and you will need to specify a temporary directory (e.g. upload_tmp_dir) which is not set in php.ini. see [[bugzilla:6650]] and [[bugzilla:7652]]. Many Php applications needs this setting, most of known are wordpress, roudcube, egroupware, etc. Symptoms are that you can't upload contents to the PHP application.
+
From SME Server V8 up to and including SME Server V9, you could sometimes have an error thrown by PHP and would then need to specify a temporary directory (e.g. upload_tmp_dir) which is not set in php.ini. see [[bugzilla:6650]] and [[bugzilla:7652]]. Many php applications need this setting, the best-known culprits are Wordpress, Roundcube, eGroupWare, and there are others. ther symptoms observed are that you can't upload contents to the PHP application.
   −
An easy way is to make a Custom Template to resolve this issue.  see [[Uploadtmpdir]]
+
An easy resolution is to make a Custom Template to resolve this issue.  see [[Uploadtmpdir]]
    
----
 
----
    
[[Category: Howto]]
 
[[Category: Howto]]

Navigation menu