0

Actualizando PHP 5.2 a PHP 5.4

hasta ahora he estado trabajando con la versión antigua de PHP, ya que todos los sistemas estaban corriendo con normalidad, hemos tenido como una nueva versión de una aplicación, y por ellos nos vemos en la obligación de utilizar la versión 5.4 ….. ahora?

era necesario realizar unas cuantas maniobras para dicha actualización, porque no basta solo un yum php update    es ir mucho más allá.

solo para verificar las versiones y los paquetes que tenemos instalado.

# rpm -aq
# yum list installed

bueno,  para comprobar la versión del php:

root@calivent~]#php -v
PHP 5.2.17 (cli) (built: Dec 18 2013 16:48:28)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
    with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

creamos un backup del /usr/local/lxlabs/kloxo/file/phpini/htaccesstemp y creamos uno nuevo con el siguiente contenido.

php_value upload_max_filesize 128M
php_value max_execution_time  120
php_value max_input_time  -1
php_value memory_limit  128M
php_value post_max_size  128M
php_flag display_errors  __lx__display_error_flag
php_flag file_uploads  __lx__file_uploads_flag
php_flag log_errors  __lx__log_errors_flag
php_flag output_buffering  __lx__output_buffering_flag
php_flag register_argc_argv  __lx__register_argc_argv_flag
php_flag mysql.allow_persistent  __lx__mysql_allow_persistent_flag
php_flag register_long_arrays  __lx__register_long_arrays_flag
php_flag allow_url_fopen  __lx__allow_url_fopen_flag
php_flag cgi.force_redirect  __lx__cgi_force_redirect_flag
php_flag enable_dl  __lx__enable_dl_flag

lo protejemos antes posibles actualizaciones que alteren nuestro nuevo archivo.

[root@calivent ~]# chattr +i /usr/local/lxlabs/kloxo/file/phpini/htaccesstemp

lo mismo hacemos con el otro archivo /usr/local/lxlabs/kloxo/file/phpini/php.ini.temp sacamos el backup, y creamos uno nuevo con el siguiente contenido.

[PHP]
engine = On
asp_tags = Off
precision = 14
output_buffering = __lx__output_buffering_flag
zlib.output_compression = __lx__output_compression_flag
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
disable_functions = shell_exec
disable_classes =
zend.enable_gc = On
expose_php = Off
max_execution_time = 180
max_input_time = -1
memory_limit = 128M
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
display_errors = __lx__display_error_flag
display_startup_errors = Off
log_errors = __lx__log_errors_flag
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = __lx__register_argc_argv_flag
auto_globals_jit = On
post_max_size = 128M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root =
user_dir =
enable_dl = __lx__enable_dl_flag
file_uploads = __lx__file_uploads_flag
upload_max_filesize = 128M
max_file_uploads = 20
allow_url_fopen = __lx__allow_url_fopen_flag
allow_url_include = __lx__allow_url_include_flag
default_socket_timeout = 60
[CLI Server]
cli_server.color = On
[Date]
[filter]
[iconv]
[intl]
[sqlite]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
[mail function]
SMTP = localhost
smtp_port = 25
sendmail_path = /usr/sbin/sendmail -t -i
mail.add_x_header = On
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = __lx__mysql_allow_persistent_flag
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.save_path = __lx__session_save_path_flag
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = Off
session.bug_compat_warn = Off
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off
[Assertion]
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[mcrypt]
[dba]

date.timezone = "Europe/Warsaw"

zend_extension=/usr/lib/kloxophp/ioncube/ioncube_loader_lin_5.4.so
zend_extension=/usr/lib/php/modules/opcache.so
extension=/usr/lib/php/modules/apc.so

opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
opcache.save_comments=0
opcache.enable_file_override=1

de la misma manera lo protejemos antes ediciones posteriores.

[root@calivent~]# chattr +i /usr/local/lxlabs/kloxo/file/phpini/php.ini.temp

descargaremos y desempaquetaremos el IonCube compatible con esta versión del PHP

[root@calivent kloxophp]# cd /usr/lib/kloxophp

  •  Para 64 bit
  • [root@calivent kloxophp]# wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
  • Para 32 bit
  • [root@calivent kloxophp]# wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz

descomprimimos y desempaquetamos en esta misma ruta: tar -xzvf ioncube_loaders_lin_*.tar.gz

tambien instalamos Zend Optimizer

curl -LOk https://github.com/zendtech/ZendOptimizerPlus/archive/master.zip

unzip master.zip

cd ZendOptimizerPlus-master

/usr/bin/phpize

./configure  --with-php-config=/usr/bin/php-config

make && make install

como no nos basamos en los repositorios estandares,  utilizaremos los repositorios REMI

wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm

 

yum update php –enablerepo=remi

Isntalamos APC cache,

[root@calivent ~]# pecl install apc

/script/fixphp

 

Reiniciamos el servidor Web

 /etc/init.d/httpd restart

 

Comprobamos si funciona

[root@kloxo ~]#php -v
PHP 5.4.25 (cli) (built: Feb 11 2014 09:00:15)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

voilá!!! Funciona!.

 

 

calivent

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *