Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-12-04 11:34:32

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 446
Website

Database Unavailable with PHP 5.5.21

I updated to PHP 5.5.21 and my Textpattern site gave me a “Database unavailable” error. When I go back to an earlier PHP version, the database is available again.

I use Textpattern version 4.5.7, installed in a subfolder.

I need the newer PHP version for another site on the same domain.

Do you know how to solve this?


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#2 2015-12-04 12:18:26

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: Database Unavailable with PHP 5.5.21

Hi Kjeld,
Are you certain this is not a temporary server error?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2015-12-04 12:29:48

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 446
Website

Re: Database Unavailable with PHP 5.5.21

colak wrote #296960:

Hi Kjeld,
Are you certain this is not a temporary server error?

Thank you, Colak.

I tested turning the higher version of PHP on and off several times. When I use the higher version, the error occurs. When I use the lower version, it doesn’t.

That was also not suggested as an option by the support person of my hosting service. Additionally, the site showed the error for over 24 hours before I discovered that the PHP setting caused the problem.

How could it be a server error?

Last edited by Kjeld (2015-12-04 12:31:04)


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#4 2015-12-04 12:56:16

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Database Unavailable with PHP 5.5.21

I’ve just tested a local install of Textpattern 4.5.7 on PHP 5.5.26 (the closest version I have available to your PHP setup) and it works without error for me.

Offline

#5 2015-12-04 13:02:50

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: Database Unavailable with PHP 5.5.21

I have some of my sites txp v. 4.5.7 running on PHP version 5.6.14 so I do not think that php is the culprit. What is the combinations of php/mysql versions you are trying?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#6 2015-12-04 13:35:12

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Database Unavailable with PHP 5.5.21

Perhaps there’s a difference in how the two PHP versions are configured.
Try visiting a page containing only <?php phpinfo(); ?> and see what the differences are between the two versions.

Offline

#7 2015-12-04 13:42:53

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Database Unavailable with PHP 5.5.21

+1 to what Ruud says – do a before and after of phpinfo and see what happens. I wonder if the upgrade to PHP 5.5 broke the MySQL glue (i.e., php5 was upgraded properly, but not php5-mysql).

Offline

#8 2015-12-04 16:41:11

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 446
Website

Re: Database Unavailable with PHP 5.5.21

philwareham wrote #296962:

I’ve just tested a local install of Textpattern 4.5.7 on PHP 5.5.26 (the closest version I have available to your PHP setup) and it works without error for me.

Thank you

colak wrote #296963:

I have some of my sites txp v. 4.5.7 running on PHP version 5.6.14 so I do not think that php is the culprit. What is the combinations of php/mysql versions you are trying?

ruud wrote #296966:

Perhaps there’s a difference in how the two PHP versions are configured.
Try visiting a page containing only <?php phpinfo(); ?> and see what the differences are between the two versions.

gaekwad wrote #296968:

+1 to what Ruud says – do a before and after of phpinfo and see what happens. I wonder if the upgrade to PHP 5.5 broke the MySQL glue (i.e., php5 was upgraded properly, but not php5-mysql).

Thank you for the assistance!

Both combinations of php/mysql versions appear to use the same MySQL Version: 5.1.26-rc-5.1.26rc-log (That’s what phpMyAdmin shows).

I am not quite sure what to look for in the phpinfo files, so I created pdf files of them. I can send them privately if that helps.

Last edited by Kjeld (2015-12-04 16:47:14)


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#9 2015-12-04 17:25:55

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Database Unavailable with PHP 5.5.21

Go ahead and send them. I’ll have a look.
Could you also save them as HTML files (sometimes easier to see the difference then).

Offline

#10 2015-12-04 17:32:04

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 446
Website

Re: Database Unavailable with PHP 5.5.21

ruud wrote #296973:

Go ahead and send them. I’ll have a look.
Could you also save them as HTML files (sometimes easier to see the difference then).

Thanks, Ruud. Just sent you an e-mail. It’s pretty late in Japan now and I have to crash, so my next response will take a little while.


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#11 2015-12-04 17:40:35

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Database Unavailable with PHP 5.5.21

The one with the newer PHP version has mysql.default_socket set to “no value”, so the error was probably caused because PHP didn’t know how to connect to the database.
You can change this in the php.ini file for that version or add the following line to your config.php:

ini_set('mysql.default_socket', '/var/run/mysqld/mysqld.sock');

Let us know if that solved the problem.

Perhaps related to this, the configure command (at the top of the phpinfo output) shows that the older PHP version was compiled with --with-mysql=/usr/bin/mysql_config, while the newer was compiled with just --with-mysql. (shouldn’t be a problem, the newer version just defaults to using mysqlnd)

With the next TXP version this will be solved, because it will use mysqli instead of mysql and that appears to be configured correctly in both PHP versions.

Offline

#12 2015-12-04 17:50:58

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 446
Website

Re: Database Unavailable with PHP 5.5.21

ruud wrote #296975:

The one with the newer PHP version has mysql.default_socket set to “no value”, so the error was probably caused because PHP didn’t know how to connect to the database.
You can change this in the php.ini file for that version or add the following line to your config.php:

ini_set('mysql.default_socket', '/var/run/mysqld/mysqld.sock');...

Let us know if that solved the problem.

Thanks, Ruud. The php.ini file that I can access doesn’t mention mysql.default_socket and it is the same for both php versions. I added the code to the txp config.php, but it had no effect.


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

Board footer

Powered by FluxBB