Changes

From SME Server
Jump to navigationJump to search
3,802 bytes added ,  05:22, 18 September 2021
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 available. By default we provide the following versions : 54 (base one maintained by Red-Hat), 55, 56, 70, 71, 72, 73, 74, 80.
 +
 +
=== Available properties ===
 +
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"
 +
|+db configuration properties
 +
!keys
 +
!role
 +
!
 +
|-
 +
|php
 +
|customization of /etc/php.ini
 +
|for php54
 +
|-
 +
|php55
 +
|customization of /opt/remi/php55/root/etc/php.ini
 +
| rowspan="8" |if no properties defined, will use php keys properties
 +
|-
 +
|php56
 +
|customization of /opt/remi/php56/root/etc/php.ini
 +
|-
 +
|php70
 +
|customization of /etc/opt/remi/php70/php.ini
 +
|-
 +
|php71
 +
|customization of /etc/opt/remi/php71/php.ini
 +
|-
 +
|php72
 +
|customization of /etc/opt/remi/php72/php.ini
 +
|-
 +
|php73
 +
|customization of /etc/opt/remi/php73/php.ini
 +
|-
 +
|php74
 +
|customization of /etc/opt/remi/php74/php.ini
 +
|-
 +
|php80
 +
|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 reallly want to disable one version of php, you need to do for php55
 +
config setprop php55-php-fpm status disabled
 +
signal-event webapps-update
 +
 +
<br />
 +
{| class="wikitable"
 +
|+
 +
!php setting
 +
!ibay property
 +
!php.ini property
 +
!default
 +
!note
 +
|-
 +
| -
 +
|PHPVersion
 +
| -
 +
|74
 +
|can vary upon update if left empty
 +
|-
 +
|allow_url_fopen
 +
|AllowUrlfOpen
 +
|AllowUrlFopen
 +
|off
 +
|unsecure keep to off
 +
|-
 +
|allow_url_include
 +
| -
 +
| -
 +
|off
 +
|
 +
|-
 +
|auto_prepend_file
 +
|AutoPrependFile
 +
| -
 +
|enabled
 +
|/usr/share/php/auth_translation.php unless disabled
 +
|-
 +
|disable_functions
 +
|DisabledFunctions
 +
| -
 +
|system,show_source, symlink,exec,dl,shell_exec,passthru,phpinfo,escapeshellarg,escapeshellcmd
 +
|
 +
|-
 +
|display_errors
 +
|DisplayErrors
 +
| -
 +
|off
 +
|
 +
|-
 +
|error_log
 +
| -
 +
| -
 +
|/var/log/php/$key/error.log
 +
|
 +
|-
 +
|error_reporting
 +
|ErrorReporting
 +
| -
 +
|E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
 +
|
 +
|-
 +
|expose_php
 +
| -
 +
|ExposePHP
 +
|Off
 +
|
 +
|-
 +
|file_upload
 +
|FileUpload
 +
| -
 +
|Off
 +
|
 +
|-
 +
|mail.add_x_header
 +
| -
 +
|MailAddXHeader
 +
|disabled
 +
|only global, not per php version
 +
|-
 +
|mail.force_extra_parameters
 +
|MailForceSender
 +
|MailForceSender
 +
|root@$DomainName
 +
|ibayname@$DomainName for ibays
 +
|-
 +
|mail.log
 +
| -
 +
|MailLog
 +
|disabled
 +
|
 +
|-
 +
|max_execution_time
 +
|MaxExecutionTime
 +
|MaxExecutionTime
 +
|30
 +
|
 +
|-
 +
|max_file_uploads
 +
| -
 +
|MaxFileUpload
 +
|20
 +
|
 +
|-
 +
|max_input_time
 +
|MaxInputTime
 +
|MaxInputTime
 +
|60
 +
|
 +
|-
 +
|memory_limit
 +
|MemoryLimit
 +
|MemoryLimit
 +
|128M
 +
|
 +
|-
 +
|open_basedir
 +
|PHPBaseDir
 +
| -
 +
|/home/e-smith/files/ibays/IBAYNAME/:/var/lib/php/IBAYNAME/:/usr/share/php/:/usr/share/pear/:/opt/remi/php$version/root/usr/share/pear/:/opt/remi/php$version/root/usr/share/php/
 +
|
 +
|-
 +
|post_max_size
 +
|PostMaxSize
 +
|PostMaxSize
 +
|20M
 +
|
 +
|-
 +
|security.limit_extensions
 +
|AllowPHTML
 +
|
 +
|disabled
 +
|allow php to interprete more file (.php .htm .html .phar .phtml .xml)
 +
|-
 +
|sendmail_from
 +
| -
 +
|MailForceSender
 +
|root@$DomainName
 +
|
 +
|-
 +
|sendmail_path
 +
| -
 +
|SendmailPath
 +
|/usr/sbin/sendmail -t -i
 +
|
 +
|-
 +
|short_open_tag
 +
| -
 +
|ShortOpenTag
 +
|On
 +
|
 +
|-
 +
|upload_max_filesize
 +
|UploadMaxFilesize
 +
|UploadMaxFilesize
 +
|10M
 +
|
 +
|}
 +
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:
 +
db accounts setprop MYIBAY disable_functions none PHPVersion 80
 +
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.}}
 +
 
===Display Error Messages===
 
===Display Error Messages===
   Line 8: Line 209:  
{{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 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.}}
   −
====Enable changes====
+
====Enable changes for all php versions====
 
If you (for debugging purposes for instance) would like to enable it you can do it with the instructions found below:
 
If you (for debugging purposes for instance) would like to enable it you can do it with the instructions found below:
   Line 44: Line 245:  
  /etc/rc7.d/S86httpd-e-smith restart
 
  /etc/rc7.d/S86httpd-e-smith restart
    +
====Enable changes for a specific ibay====
 +
Starting SME10 and smeserver-php-3.0.0-39
 +
db accounts setprop MYIBAY DisplayErrors enabled
 +
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 it's own tree in other words it creates a 'sandbox' or 'jail'.
Line 58: Line 263:  
<ol>
 
<ol>
 
(Please also see: [http://wiki.contribs.org/Useful_Commands#PHP_Related_Commands these] instructions on the [http://wiki.contribs.org/Useful_Commands Useful_Commands] page.)
 
(Please also see: [http://wiki.contribs.org/Useful_Commands#PHP_Related_Commands these] instructions on the [http://wiki.contribs.org/Useful_Commands Useful_Commands] page.)
<!--Please do not remove the following closing tag as a fromatting/rendering bug will kick in, for more details see: http://bugzilla.wikimedia.org/show_bug.cgi?id=10893--></li><li>Open a SME Server shell as root user and document the current setting of the PHPBaseDir directive by writing down the output of the following command:
+
<!--Please do not remove the following closing tag as a fromatting/rendering bug will kick in, for more details see: http://bugzilla.wikimedia.org/show_bug.cgi?id=10893--><li>Open a SME Server shell as root user and document the current setting of the PHPBaseDir directive by writing down the output of the following command:
 
  db accounts getprop ibayname PHPBaseDir  
 
  db accounts getprop ibayname PHPBaseDir  
 
Be careful to write it down to the letter as we need it in the next step
 
Be careful to write it down to the letter as we need it in the next step
Line 65: Line 270:  
</li><li>Decide on what directory you would like to add and issue the following:
 
</li><li>Decide on what directory you would like to add and issue the following:
 
  db accounts setprop ibayname PHPBaseDir value
 
  db accounts setprop ibayname PHPBaseDir value
   
Replace ibayname with the name of the ibay and value with the old value for the PHPBaseDir directive you have written down and a colon (:) followed by the full path to the directory you would like to add with a tailing slash (/), e.g.
 
Replace ibayname with the name of the ibay and value with the old value for the PHPBaseDir directive you have written down and a colon (:) followed by the full path to the directory you would like to add with a tailing slash (/), e.g.
 
  db accounts setprop Primary PHPBaseDir /home/e-smith/files/ibays/Primary/html/:/opt/gallery2/
 
  db accounts setprop Primary PHPBaseDir /home/e-smith/files/ibays/Primary/html/:/opt/gallery2/
   
Above command would allow for invocation of scripts in the /opt/gallery2 path from the Primary ibay html folder by PHP.
 
Above command would allow for invocation of scripts in the /opt/gallery2 path from the Primary ibay html folder by PHP.
   
To allow uploading of files to via http to a ibay name wiki
 
To allow uploading of files to via http to a ibay name wiki
 
  db accounts setprop wiki PHPBaseDir /home/e-smith/files/ibays/wiki/:/tmp/
 
  db accounts setprop wiki PHPBaseDir /home/e-smith/files/ibays/wiki/:/tmp/
Line 101: Line 303:  
See also:
 
See also:
   −
* [[bugzilla:1120]]
+
*[[bugzilla:1120]]
* [[bugzilla:2132]]
+
*[[bugzilla:2132]]
* http://forums.contribs.org/index.php?topic=31518
+
*http://forums.contribs.org/index.php?topic=31518
    
===PHP 5 with php-mcrypt===
 
===PHP 5 with php-mcrypt===
Line 113: Line 315:     
<ol>
 
<ol>
</li><li>Download php-mcrypt rpms needed
+
<li>Download php-mcrypt rpms needed
 
   
  cd /tmp
 
  cd /tmp
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-common-5.2.10-1.el5.remi.i386.rpm
+
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-common-5.2.10-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-mcrypt-5.2.10-1.el5.remi.i386.rpm
+
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-mcrypt-5.2.10-1.el5.remi.i386.rpm
   −
</li><li>Make a backup of your current php.ini file''' ''(because the install will change the file)
+
</li><li>Make a backup of your current php.ini file'(because the install will change the file)
    
  cp /etc/php.ini /etc/php.ini.org
 
  cp /etc/php.ini /etc/php.ini.org
Line 134: Line 335:     
  mv /etc/php.ini /etc/php.ini.old
 
  mv /etc/php.ini /etc/php.ini.old
mv /etc/php.ini.org /etc/php.ini
+
mv /etc/php.ini.org /etc/php.ini
    
</li><li>Restart all services
 
</li><li>Restart all services
Super Admin, Wiki & Docs Team, Bureaucrats, Interface administrators, Administrators
3,258

edits

Navigation menu