Upgrading to PHP 5.6.9

Issues related to applications and software problems
User avatar
remirepo
Posts: 282
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: Upgrading to PHP 5.6.9

Postby remirepo » 2015/05/18 05:45:59

For Apache you need "mod_php" (work out of the box, package is "php") or "php-fpm" (need some configuration)
Remi's Repository - Forum - Blog

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Upgrading to PHP 5.6.9

Postby Kunwar » 2015/05/18 17:19:34

The issue is not with mysql it's with PHP... php has stopped ever since I installed php-mysqlnd.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Upgrading to PHP 5.6.9

Postby gerald_clark » 2015/05/18 17:47:23

You installed php-mysqlnd, but are running an unsupported mysql.

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Upgrading to PHP 5.6.9

Postby Kunwar » 2015/05/19 22:07:42

I have uninstalled mysql-community and installed mariadb instead but I can get mariadb to start... I have eliminated the logs file error and all. but stuck at this one error... I am clueless what to do.

The starting the service failed and this is what I found in the log file:

Code: Select all

150520 03:00:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150520  3:00:10 InnoDB: The InnoDB memory heap is disabled
150520  3:00:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150520  3:00:10 InnoDB: Compressed tables use zlib 1.2.7
150520  3:00:10 InnoDB: Using Linux native AIO
150520  3:00:10 InnoDB: Initializing buffer pool, size = 128.0M
150520  3:00:10 InnoDB: Completed initialization of buffer pool
150520  3:00:10 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 1889328
150520  3:00:10  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1889994
150520  3:00:10  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
150520  3:00:11  InnoDB: Waiting for the background threads to start
150520  3:00:11  InnoDB: Warning: table 'mysql/innodb_table_stats'
InnoDB: in InnoDB data dictionary has unknown flags 50.
150520  3:00:11  InnoDB: Warning: table 'mysql/innodb_index_stats'
InnoDB: in InnoDB data dictionary has unknown flags 50.
150520  3:00:12 Percona XtraDB (http://www.percona.com) 5.5.40-MariaDB-36.1 started; log sequence number 1889994
150520  3:00:12 [Note] Plugin 'FEEDBACK' is disabled.
150520  3:00:12 [Note] Server socket created on IP: '0.0.0.0'.
150520  3:00:12 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
150520 03:00:12 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended


gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Upgrading to PHP 5.6.9

Postby gerald_clark » 2015/05/19 22:17:14

Likely MariaDB is not compatible with the database files left by the comunity MySQL.
You should completely remove all the files in the database directory and start afresh.
If your databases had any important data in them you should have dumped them prior to the change.

igro
Posts: 77
Joined: 2010/08/27 00:41:25

Re: Upgrading to PHP 5.6.9

Postby igro » 2015/05/19 23:57:30

remmi and gerald_clark write right things.
you need mod_php for apache.
and yes you have to get dump of databases before removing mysql.
if you don't but not deleted database files yet then you can remove mariadb than install mysql and get dumps then remove mysql and install mariadb :mrgreen:
here is example output from one of my servers:
[root@frankenstein ~]# rpm -qa|grep -w php
php-5.3.28-4.el6.x86_64
php-pear-1.9.4-4.el6.noarch
php-common-5.3.28-4.el6.x86_64
php-devel-5.3.28-4.el6.x86_64
php-pdo-5.3.28-4.el6.x86_64
php-ldap-5.3.28-4.el6.x86_64
php-pecl-memcache-3.0.5-4.el6.x86_64
php-cli-5.3.28-4.el6.x86_64
php-magickwand-1.0.9-1.el6.x86_64
php-gd-5.3.28-4.el6.x86_64
php-mcrypt-5.3.28-4.el6.x86_64
php-mbstring-5.3.28-4.el6.x86_64
php-mysqlnd-5.3.28-4.el6.x86_64
php-pecl-imagick-2.2.2-4.el6.x86_64
[root@frankenstein ~]# rpm -qa|grep -w mariadb
[root@frankenstein ~]# rpm -qa|grep -wi mariadb
MariaDB-server-5.5.42-1.el6.x86_64
MariaDB-compat-5.5.42-1.el6.x86_64
MariaDB-common-5.5.42-1.el6.x86_64
MariaDB-client-5.5.42-1.el6.x86_64
MariaDB-devel-5.5.42-1.el6.x86_64
[root@frankenstein ~]# apachectl -M|grep -i php
Syntax OK
php5_module (shared)
suphp_module (shared)

before install mariadb:
1. make backup of my.cnf and remove
2. make backup of database files and remove
3. install mariadb
4. check if installer installed database files (usually /var/lib/mysql)
5. if mariadb not installed database files then run mysql_install_db
6. chown mysql:mysql /var/lib/mysql

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Upgrading to PHP 5.6.9

Postby Kunwar » 2015/05/20 00:36:57

Thanks Guys, I was able to install and run mariadb successfully. Now I wanted to install php.. I used # yum install php php-mysql... Which gave me the following

Code: Select all


============================================================================================================================================
 Package                           Arch                         Version                                    Repository                  Size
============================================================================================================================================
Installing:
 php                               x86_64                       5.4.16-23.el7_0.3                          base                       1.3 M
 php-mysqlnd                       x86_64                       5.4.16-23.el7_0.3                          base                       170 k
Installing for dependencies:
 php-cli                           x86_64                       5.4.16-23.el7_0.3                          base                       2.7 M
 php-common                        x86_64                       5.4.16-23.el7_0.3                          base                       561 k
 php-pdo                           x86_64                       5.4.16-23.el7_0.3                          base                        95 k

Transaction Summary
============================================================================================================================================
Install  2 Packages (+3 Dependent packages)



All the packages are 5.4 and I need 5.6 for my script to work. I downloaded 5.6.9.tar.gz from PHP's website... but I am not sure if it's going to work with mariadb...

I found some packages at this link https://dl.iuscommunity.org/pub/ius/sta ... /repoview/ but I am not sure how to use them and which one to use.

What do you guys suggest?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Upgrading to PHP 5.6.9

Postby gerald_clark » 2015/05/20 00:49:32

IUS has PHP56u and associated modules to go along with it.
These will not collide with the CentOS supplied packages.

igro
Posts: 77
Joined: 2010/08/27 00:41:25

Re: Upgrading to PHP 5.6.9

Postby igro » 2015/05/20 01:08:22

you can use bleeding edge like repositories
for example atomicorp: https://www.atomicorp.com/wiki/index.php/Atomic
but before install php from atomic repo disable other third party repos like rpmforge and etc (excluding epel) or you will get dependencies error
dont afraid...there is no problem between php and sql...problem can be in module of php that should work with sql.
in old version of php was used php-mysql or php-mysqli or php-pdo but in new versions you should use php-mysqlnd.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Upgrading to PHP 5.6.9

Postby gerald_clark » 2015/05/20 01:46:07

Avoid atomic repo. It will silently replace core packages.
Stick with epel, nux-dextop and IUS.
IUS is provided by the RACKSPACE people for use with their cloud servers.
It plays nice with the CentOS repos,