Difference between revisions of "PHP5"

From SME Server
Jump to navigationJump to search
 
(10 intermediate revisions by 7 users not shown)
Line 4: Line 4:
  
 
[http://sme.firewall-services.com Firewall Services] (original contrib)
 
[http://sme.firewall-services.com Firewall Services] (original contrib)
 +
 +
=== Version ===
 +
{{ #smeversion: smeserver-php5-cgi }}<br/><br/><br/><br/>
 +
{{ #smeversion: php5-cgi }}<br/><br/><br/><br/>
  
 
===Description===
 
===Description===
Line 11: Line 15:
  
 
===Installation===
 
===Installation===
Firstly, download the integration RPM and the PHP packages Zip file:
+
To install the contrib, issue the following command from the console:
 
 
wget http://sme.david-harper.com/data/smeserver-php5-cgi-1.0-2.noarch.rpm
 
wget http://sme.david-harper.com/data/php5-cgi.zip
 
 
 
Next, unzip the PHP5 archive:
 
 
 
unzip php5-cgi.zip
 
 
 
Then install the packages:
 
  
  yum localinstall smeserver-php5-cgi*.rpm php5-cgi*.rpm
+
  yum --enablerepo=smecontribs install smeserver-php5-cgi
 
  signal-event post-upgrade ; signal-event reboot
 
  signal-event post-upgrade ; signal-event reboot
  
Line 28: Line 23:
 
To upgrade from Firewall Services' earlier release, you must do as follows:
 
To upgrade from Firewall Services' earlier release, you must do as follows:
  
1. Delete ALL custom templates created while following the earlier [http://sme.firewall-services.com/spip.php?article46 Firewall Services howto].
+
1. Remove Packages:
 +
rpm -e php5-cgi*
 +
 
 +
2. Remove Custom Template
 +
rm /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/80php5-cgi
 +
 
 +
3. Remove Any config for web apps
 +
rm /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90<webappname>
  
 +
4. Expand Templates & Reboot
 +
signal-event post-upgrade
 +
signal-event reboot
 
{{Note box|The structure of the contrib has changed since the Firewall Services howto was written; be sure to delete ALL old custom templates.}}
 
{{Note box|The structure of the contrib has changed since the Firewall Services howto was written; be sure to delete ALL old custom templates.}}
  
2. Install the updated contrib as above.
+
5. Install the updated contrib as above.
 +
 
 +
6. Follow the instructions below to enable PHP5 for your web applications.
  
3. Follow the instructions below to enable PHP5 for your web applications.
+
(Based on suggested workaround in [[Bugzilla:6108]])
  
 
===Usage===
 
===Usage===
Line 51: Line 58:
  
 
====For contribs====
 
====For contribs====
Web applications that are installed in /opt can also be configured to use PHP5. Ideally, application packagers should update their integration RPMs to depend on smeserver-php5-cgi and deploy a new template fragment, but if you wish, you can also configure PHP5 manually.
+
Web applications that are installed in /opt can also be configured to use PHP5. Ideally, application packagers should update their integration RPMs to depend on smeserver-php5-cgi and deploy a new template fragment, but if you wish, you can also configure PHP5 manually.[[Here are two shell scripts]] that will switch between PHP v4 and v5.
  
{{Note box|The structure of the contrib has changed from eariler releases; be sure to delete ALL old custom templates.}}
+
{{Note box|The structure of the contrib has changed from earlier releases; be sure to delete ALL old custom templates.}}
  
 
First, create a custom template:
 
First, create a custom template:
Line 92: Line 99:
 
Please raise bugs under the SME-Contribs section in {{BugzillaFileBug|product=|component=|title=bugzilla}}.
 
Please raise bugs under the SME-Contribs section in {{BugzillaFileBug|product=|component=|title=bugzilla}}.
  
[[Category: Contrib]]
+
[[Category: Deprecated Contrib]]
[[Category: Webapps]]
 

Latest revision as of 06:26, 18 April 2021


Maintainer

David Harper (current maintainer)

Firewall Services (original contrib)

Version

smeserver-php5-cgi
The latest version of smeserver-php5-cgi is available in the SME repository, click on the version number(s) for more information.





php5-cgi
The latest version of php5-cgi is available in the SME repository, click on the version number(s) for more information.





Description

This contrib allows you to install PHP version 5 alongside PHP version 4, which is the default in SME Server 7.x. Unlike a full upgrade to PHP5, installation of this contrib will not affect your ability to install future updates to SME Server 7.x. PHP 4 remains the default version.


Warning.png Warning:
This is a beta-quality release. Beware. For non-production testing only.


Installation

To install the contrib, issue the following command from the console:

yum --enablerepo=smecontribs install smeserver-php5-cgi
signal-event post-upgrade ; signal-event reboot

Upgrade

To upgrade from Firewall Services' earlier release, you must do as follows:

1. Remove Packages:

rpm -e php5-cgi*

2. Remove Custom Template

rm /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/80php5-cgi

3. Remove Any config for web apps

rm /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90<webappname>

4. Expand Templates & Reboot

signal-event post-upgrade
signal-event reboot
Important.png Note:
The structure of the contrib has changed since the Firewall Services howto was written; be sure to delete ALL old custom templates.


5. Install the updated contrib as above.

6. Follow the instructions below to enable PHP5 for your web applications.

(Based on suggested workaround in Bugzilla:6108)

Usage

PHP5 can be used in Ibays and for contribs that are installed in /opt.

For Ibays

To configure an Ibay to use PHP 5, run the following commands from the shell:

db accounts setprop [ibayname] php5 yes
signal-event ibay-modify [ibayname]

To return to the default version of PHP, run the following command from the shell:

db accounts setprop [ibayname] php5 no
signal-event ibay-modify [ibayname]

For contribs

Web applications that are installed in /opt can also be configured to use PHP5. Ideally, application packagers should update their integration RPMs to depend on smeserver-php5-cgi and deploy a new template fragment, but if you wish, you can also configure PHP5 manually.Here are two shell scripts that will switch between PHP v4 and v5.


Important.png Note:
The structure of the contrib has changed from earlier releases; be sure to delete ALL old custom templates.


First, create a custom template:

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90[MyAppName]

Next, put the following lines in the new file:

<Directory /opt/[myapp]>
       AddHandler php5-cgi .php
       Action php5-cgi /php5-cgi/php-cgi
</Directory>

Save and exit (CTRL-O, CTRL-X), and then expand the web server's configuration template:

expand-template /etc/httpd/conf/httpd.conf

Before you apply the changes, be sure to check that there is no error in the new configuration file:

httpd -t

If this command returns ’Syntax OK’, you can restart the web server:

svc -t /service/httpd-e-smith

Options

You can fine-tune PHP5 using the e-smith configuration database. To keep things simple, PHP5 inherits the same settings as PHP4. To modify a property, issue the following commands from the SME Server shell:

db configuration setprop php [property] [value]
expand-template /etc/php5/php.ini

Note that any changes will also affect PHP4. To apply the changes to PHP4 immediately, run:

expand-template /etc/php.ini

Bugs

Please raise bugs under the SME-Contribs section in bugzilla .