Difference between revisions of "PHP"

From Atomicorp Wiki
Jump to: navigation, search
m (How do I install PHP 5.3 with Mysql 5.0?)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Features ==
+
'''[https://www.atomicorp.com/products/asl.html Brought to you by the makers of Atomic Secured Linux.  Secure your server now!]'''
  
* Currently using the 5.2.x branch
+
= PHP 5.3 =
* Backported mail logging feature from 5.3, this allows for either a header to be inserted into the sent message indicating the source script, or a log event to a custom log file.
+
 
 +
PHP 5.3 is available through the [[Nucleus]] yum repository.
 +
 
 +
== PHP 5.3 Features ==
 +
 
 +
Please see the [https://www.atomicorp.com/wiki/index.php/Nucleus#Features PHP Nucleus 5.3 page]
 +
 
 +
== PHP 5.3 Installation ==
 +
 
 +
Please see the [[Nucleus]] page.
 +
 
 +
= PHP 5.4 =
 +
 
 +
PHP 5.4 is available through the Atomic yum repository.
 +
 
 +
== PHP 5.4 Features ==
 +
 
 +
* Currently using the 5.4.x branch
 
* Uses the internal PCRE library, with extended UTF-8 support
 
* Uses the internal PCRE library, with extended UTF-8 support
* Linked against the native OS database libraries (mysql4 for RHEL/CentOS4 for example)
+
* Linked against the atomic Mysql library, currently 5.5
 
* Based on the Fedora design and includes the following core modules:
 
* Based on the Fedora design and includes the following core modules:
 
** php-bcmath: support for using the bcmath library
 
** php-bcmath: support for using the bcmath library
Line 12: Line 29:
 
** php-devel: files needed for building PHP extensions
 
** php-devel: files needed for building PHP extensions
 
** php-embedded: library which can be embedded into applications to provide PHP scripting
 
** php-embedded: library which can be embedded into applications to provide PHP scripting
 +
** php-enchant: Enchant library support
 
** php-gd: support for using the gd graphics library
 
** php-gd: support for using the gd graphics library
 
** php-imap: IMAP support
 
** php-imap: IMAP support
Line 17: Line 35:
 
** php-mbstring: multi-byte string handling
 
** php-mbstring: multi-byte string handling
 
** php-mcrypt: mcrypt support
 
** php-mcrypt: mcrypt support
** php-mhash: mhash support
 
 
** php-mssql: Microsoft SQL server support
 
** php-mssql: Microsoft SQL server support
** php-mysql: mysql and mysqli database modules
+
** php-mysql: mysql, and mysqli database modules
** php-ncurses: ncurses library support
+
** php-mysqlnd: Native mysql driver, this does not require external mysql libraries
 
** php-odbc: ODBC support
 
** php-odbc: ODBC support
 
** php-pdo: database access abstraction layer to PHP.  This module provides a common interface for accessing MySQL, PostgreSQL or other databases
 
** php-pdo: database access abstraction layer to PHP.  This module provides a common interface for accessing MySQL, PostgreSQL or other databases
Line 37: Line 54:
 
** php-suhosin
 
** php-suhosin
 
** php-eaccelerator:
 
** php-eaccelerator:
** php-zend-optimizer
+
** php-zend-guard-loader:
** php-sqlite2: SQLite2 library for legacy support of packages like Plesk sitebuilder
+
  
 +
== PHP 5.4 Installation ==
  
  
 +
[http://www.atomicorp.com/products.html Brought to you by the makers of Atomic Secured Linux.  Secure your server now!]
  
 
+
To upgrade to PHP 5.4.x on CentOS/RHEL/Fedora:
 
+
== Installation ==
+
 
+
 
+
[http://www.progllc.com/products/asl.html Brought to you by the makers of Atomic Secured Linux.  Secure your server now!]
+
 
+
To upgrade to PHP 5.2.x on CentOS/RHEL/Fedora:
+
  
 
Step 1) Set up the atomic channel:
 
Step 1) Set up the atomic channel:
  wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh
+
  wget -q -O - http://www.atomicorp.com/installers/atomic | sh
  
Step 2) Upgrade to PHP 5.2.x:
+
Step 2) Upgrade to PHP 5.4.x:
 
  yum upgrade
 
  yum upgrade
  
Step 3) Replace the PHP 4 php.ini with PHP 5.2.x's (if applicable):
+
Step 3) Replace the PHP 4 php.ini with PHP 5.3.x's (if applicable):
 
  mv /etc/php.ini.rpmnew /etc/php.ini
 
  mv /etc/php.ini.rpmnew /etc/php.ini
  
Step 4) Replace the php.conf with the PHP 5.2.x php.conf (if applicable):
+
Step 4) Replace the php.conf with the PHP 5.4.x php.conf (if applicable):
 
  mv /etc/httpd/conf.d/php.conf.rpmnew /etc/httpd/conf.d/php.conf
 
  mv /etc/httpd/conf.d/php.conf.rpmnew /etc/httpd/conf.d/php.conf
  
Line 69: Line 80:
 
  /etc/init.d/httpd restart
 
  /etc/init.d/httpd restart
  
'''Checklist'''
+
== PHP 5.4 Checklist ==
  
1) Source code  installations of extensions, like Ioncube loader, or other extensions that have to be updated. Ive created php-ioncube-loader, php-zend-optimizer, and php-eaccelerator packages to fix this for you automatically.  
+
 
 +
1) Source code  installations of extensions, like Ioncube loader, or other extensions that have to be updated. php-ioncube-loader, php-zend-optimizer, and php-eaccelerator packages are available to fix this automatically.  
  
 
2) php.ini settings, like memory_limit
 
2) php.ini settings, like memory_limit
  
3) execstack -c on any extensions that claim to need an executible stack (ASL users only).  
+
3) execstack -c on any extensions that claim to need an executible stack (ASL users only).
 
+
'''Known Issues'''
+
 
+
1) VPS and RHEL users, If you dont use the atomic installer, you're going to miss some dependencies, like sqlite3. Have fun with that!
+
 
+
2) RHEL4 users (and possibly others) can resolve the sqlite3 dependencies by grabbing rpms from the CentOS repositories. The atomic installer fixes this for you automatically. If you dont use it... have fun with that!
+
 
+
rpm -Uvh http://isoredirect.centos.org/centos/4/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm http://isoredirect.centos.org/centos/4/os/i386/CentOS/RPMS/sqlite-devel-3.3.6-2.i386.rpm
+
 
+
up2date php
+
OR
+
yum update php
+
 
+
Works like a charm
+
 
+
3) PHP 5.2.5 causes problems with Horde and Apache configuration files on PSA 8.2.1 and lower. '''PSA 8.3.0 has fixed this problem''', so the easiest way to fix these issues is to upgrade to PSA 8.3.0 or higher. Otherwise, you'll need to perform the following extra steps:
+
 
+
3a) Modify /etc/httpd/conf.d/zz010_psa_httpd.conf
+
 
+
Change this:
+
php_admin_value include_path "/usr/share/psa-horde:/usr/share/psa-horde/pear:."
+
to
+
php_admin_value include_path "/usr/share/psa-horde/lib:/usr/share/psa-horde:/usr/share/psa-horde/pear:."
+
 
+
Note this file is changed every time plesk is updated, so you'll need to go back and fix this when it does.
+
 
+
This also fixes the '''PHP Fatal error:  Can't load Horde/SessionObjects.php, open_basedir restriction''' problem.
+
 
+
3b) General issues with php_admin_value:
+
 
+
The fix for now is to replace  the use of php_admin_value with php_value.  I have only tested this as far as the domains on this server. You will find this used all over the place in zz010_psa_httpd.conf, domain level httpd.includes, and most likely in your own customizations. The biggest problems Ive had are with register_globals and include_path, I have not run into any issues with PSA httpd.include files and open_basedir.
+
 
+
 
+
4)<strike> Plesk Sitebuilder is not compatible with 5.2.x on systems that did not come with it natively. Either remove it, with yum remove sb-publish, or you *might* be able to get it to work by using the php-sqlite2 from the Fedora 8 plesk repo.</strike> php-sqlite2 was added to the atomic repo to handle sitebuilder integration.
+
 
+
 
+
 
+
'''Problems with MySQL databases and PLESK 9 after upgrade.'''
+
 
+
If you get the following error after upgrading when you try to
+
log into PLESK then you need to upgrade your database tables:
+
 
+
ERROR: PleskFatalException
+
bad column in table: `backup_time` time NOT NULL default '00:00:00',
+
[...]
+
  
 +
= FAQ =
  
Issue the following command from the shell:
+
== Is PHP 5.3 supported? ==
  
mysqlcheck --check-upgrade --all-databases --auto-repair -uadmin -p''youradminpassword''
+
Our PHP 5.3 packages, when installed from the [[Nucleus]] repository are supported as described on the [[Nucleus]] page.
  
followed by:
+
== Is PHP 5.4 supported? ==
  
cat /usr/share/mysql/mysql_fix_privilege_tables.sql | /usr/bin/mysql --no-defaults --force --user=admin --password=''youradminpassword'' --host=localhost --database=mysql
+
Our PHP 5.4 rpm are provided for free, without support.
  
This script updates all the mysql privilege tables to be usable by the current version of MySQL.
+
== Does ASL install or replace PHP on my system? ==
  
References:
+
No, [[ASL]] does not.  ASL will not install or replace PHP on your system.
  
[http://dev.mysql.com/doc/refman/5.0/en/mysql-upgrade.html] http://dev.mysql.com/doc/refman/5.0/en/mysql-upgrade.html
+
== How do I install PHP 5.3 with Mysql 5.0? ==
  
[http://forum.parallels.com/pda/index.php/t-85461.html] http://forum.parallels.com/pda/index.php/t-85461.html
+
A: First run:  
 +
  yum install mysqlclient16

Latest revision as of 10:44, 2 August 2013

Brought to you by the makers of Atomic Secured Linux. Secure your server now!

Contents

[edit] PHP 5.3

PHP 5.3 is available through the Nucleus yum repository.

[edit] PHP 5.3 Features

Please see the PHP Nucleus 5.3 page

[edit] PHP 5.3 Installation

Please see the Nucleus page.

[edit] PHP 5.4

PHP 5.4 is available through the Atomic yum repository.

[edit] PHP 5.4 Features

  • Currently using the 5.4.x branch
  • Uses the internal PCRE library, with extended UTF-8 support
  • Linked against the atomic Mysql library, currently 5.5
  • Based on the Fedora design and includes the following core modules:
    • php-bcmath: support for using the bcmath library
    • php-cli: the command line and cgi interface for PHP
    • php-common: files used by both the php package and the php-cli package
    • php-dba: support for using the DBA database abstraction layer to PHP
    • php-devel: files needed for building PHP extensions
    • php-embedded: library which can be embedded into applications to provide PHP scripting
    • php-enchant: Enchant library support
    • php-gd: support for using the gd graphics library
    • php-imap: IMAP support
    • php-ldap: LDAP support
    • php-mbstring: multi-byte string handling
    • php-mcrypt: mcrypt support
    • php-mssql: Microsoft SQL server support
    • php-mysql: mysql, and mysqli database modules
    • php-mysqlnd: Native mysql driver, this does not require external mysql libraries
    • php-odbc: ODBC support
    • php-pdo: database access abstraction layer to PHP. This module provides a common interface for accessing MySQL, PostgreSQL or other databases
    • php-pgsql: postgres support
    • php-process: system interfaces for inter-process communication
    • php-pspell: pspell library support
    • php-recode: recode library support
    • php-snmp: SNMP support
    • php-soap: SOAP web services protocol support
    • php-tidy: tidy library support
    • php-xml: support manipulating XML documents using the DOM tree, and performing XSL transformations on XML documents.
    • php-xmlrpc: support for the XML-RPC protocol to PHP
    • php-zts: Module for Apache HTTP Server which can operate under a threaded server processing model
  • Additional modules:
    • php-ioncube-loader
    • php-suhosin
    • php-eaccelerator:
    • php-zend-guard-loader:

[edit] PHP 5.4 Installation

Brought to you by the makers of Atomic Secured Linux. Secure your server now!

To upgrade to PHP 5.4.x on CentOS/RHEL/Fedora:

Step 1) Set up the atomic channel:

wget -q -O - http://www.atomicorp.com/installers/atomic | sh

Step 2) Upgrade to PHP 5.4.x:

yum upgrade

Step 3) Replace the PHP 4 php.ini with PHP 5.3.x's (if applicable):

mv /etc/php.ini.rpmnew /etc/php.ini

Step 4) Replace the php.conf with the PHP 5.4.x php.conf (if applicable):

mv /etc/httpd/conf.d/php.conf.rpmnew /etc/httpd/conf.d/php.conf

Step 5) Restart the webserver

service httpd restart
(or)
/etc/init.d/httpd restart

[edit] PHP 5.4 Checklist

1) Source code installations of extensions, like Ioncube loader, or other extensions that have to be updated. php-ioncube-loader, php-zend-optimizer, and php-eaccelerator packages are available to fix this automatically.

2) php.ini settings, like memory_limit

3) execstack -c on any extensions that claim to need an executible stack (ASL users only).

[edit] FAQ

[edit] Is PHP 5.3 supported?

Our PHP 5.3 packages, when installed from the Nucleus repository are supported as described on the Nucleus page.

[edit] Is PHP 5.4 supported?

Our PHP 5.4 rpm are provided for free, without support.

[edit] Does ASL install or replace PHP on my system?

No, ASL does not. ASL will not install or replace PHP on your system.

[edit] How do I install PHP 5.3 with Mysql 5.0?

A: First run:

 yum install mysqlclient16
Personal tools