Skip to content
Snippets Groups Projects
Commit 377d9142 authored by jurgenhaas's avatar jurgenhaas
Browse files

PHP 5.3 adjustments

parent 58cdc8f5
No related branches found
No related tags found
No related merge requests found
......@@ -8,9 +8,6 @@
dest='{{ item }}'
state='directory'
with_items:
- '/etc/php5/cli53/conf.d/'
- '/etc/php5/cgi53/conf.d/'
- '/etc/php5/fpm/conf.d/'
- '/etc/php5/fpm/pool.d/'
- name: "Check PHP 5.3 Requirement"
......@@ -19,6 +16,17 @@
changed_when: false
- block:
- name: "Package Preferences"
template:
src='preferences/{{ item }}'
dest='/etc/apt/preferences.d/{{ item }}-pin'
owner='root'
group='root'
mode='644'
with_items:
- 'openssl'
- 'libssl'
- name: "Install Packages"
apt:
pkg={{ item }}
......@@ -32,6 +40,11 @@
- 'libssl-dev'
- 'libc-client2007e'
- 'libc-client2007e-dev'
- 'libxml2-dev'
- 'libcurl4-openssl-dev'
- 'libpng-dev'
- 'autoconf2.13'
- 'automake1.4'
- name: "Link Client Lib"
file:
......@@ -62,10 +75,18 @@
- name: "Compile PHP 5.3"
shell: "{{ item }} chdir=/tmp/php53/php-5.3.29"
with_items:
- ./configure --with-libdir=/lib/x86_64-linux-gnu --enable-fpm --enable-mbstring --enable-sockets --with-zlib --enable-zip --with-imap-ssl --with-imap --with-curl --with-mcrypt --with-gd --with-mysql --with-pdo-mysql --with-mysqli --with-gettext --with-jpeg-dir=/usr --with-png-dir=/usr --with-kerberos
- ./configure --with-libdir=/lib/x86_64-linux-gnu --enable-fpm --enable-mbstring --enable-sockets --with-zlib --enable-zip --with-imap-ssl --with-imap --with-curl --with-mcrypt --with-gd --with-mysql --with-pdo-mysql --with-mysqli --with-gettext --with-jpeg-dir=/usr --with-png-dir=/usr --with-kerberos --with-openssl --disable-cgi
- make
- make install
- name: "Create PHP53 Start Script"
template:
src='etc-init-d-php53-fpm'
dest='/etc/init.d/php-fpm'
owner='root'
group='root'
mode='755'
- name: "Add PHP-FPM to Boot-List"
command: update-rc.d php-fpm defaults
......@@ -109,18 +130,6 @@
mode='644'
with_items: '{{ php53.modules }}'
- name: "Enable PHP53 Modules"
file:
src='/etc/php5/{{ php_conf_dir }}/{{ item.0 }}.ini'
dest='/etc/php5/{{ item.1 }}/conf.d/{{ item.0 }}.ini'
state='link'
owner='root'
group='root'
mode='644'
with_nested:
- '{{ php53.modules }}'
- ['cli53', 'cgi53']
- name: "Create PHP53 INI Files"
template:
src='etc-php5-apache2-php.ini'
......@@ -131,3 +140,4 @@
with_items:
- 'cgi53'
- 'cli53'
- 'fpm'
#!/bin/sh
### BEGIN INIT INFO
# Provides: php-fpm
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php-fpm
# Description: starts the PHP FastCGI Process Manager daemon
### END INIT INFO
prefix=/usr/local
exec_prefix=${prefix}
php_fpm_BIN=${exec_prefix}/sbin/php-fpm
php_fpm_CONF=/etc/php5/fpm/php-fpm.conf
php_fpm_INI=/etc/php5/fpm/php.ini
php_fpm_PID=/var/run/php5-fpm.pid
php_opts="-c $php_fpm_INI --fpm-config $php_fpm_CONF --pid $php_fpm_PID"
wait_for_pid () {
try=0
while test $try -lt 35 ; do
case "$1" in
'created')
if [ -f "$2" ] ; then
try=''
break
fi
;;
'removed')
if [ ! -f "$2" ] ; then
try=''
break
fi
;;
esac
echo -n .
try=`expr $try + 1`
sleep 1
done
}
case "$1" in
start)
echo -n "Starting php-fpm "
$php_fpm_BIN --daemonize $php_opts
if [ "$?" != 0 ] ; then
echo " failed"
exit 1
fi
wait_for_pid created $php_fpm_PID
if [ -n "$try" ] ; then
echo " failed"
exit 1
else
echo " done"
fi
;;
stop)
echo -n "Gracefully shutting down php-fpm "
if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fi
kill -QUIT `cat $php_fpm_PID`
wait_for_pid removed $php_fpm_PID
if [ -n "$try" ] ; then
echo " failed. Use force-quit"
exit 1
else
echo " done"
fi
;;
force-quit)
echo -n "Terminating php-fpm "
if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fi
kill -TERM `cat $php_fpm_PID`
wait_for_pid removed $php_fpm_PID
if [ -n "$try" ] ; then
echo " failed"
exit 1
else
echo " done"
fi
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n "Reload service php-fpm "
if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fi
kill -USR2 `cat $php_fpm_PID`
echo " done"
;;
*)
echo "Usage: $0 {start|stop|force-quit|restart|reload}"
exit 1
;;
esac
......@@ -1966,3 +1966,18 @@ ldap.max_links = -1
[Syslog]
define_syslog_variables = Off
{% if php_version|default('5.5') == '5.3' %}
[apc]
extension = apc.so
apc.rfc1867 = 1
apc.shm_size = 256M
apc.shm_segments = 1
apc.num_files_hint = 0
[imagick]
extension=imagick.so
[xmlrpc]
extension=xmlrpc.so
{% endif %}
Package: libssl-dev
Pin: release o=LP-PPA-ondrej-apache2
Pin-Priority: -1
Package: openssl
Pin: release o=LP-PPA-ondrej-apache2
Pin-Priority: -1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment