Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2019-01-03 10:35:52

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,604

Re: Encoding problem

singaz: The open_basedir reference is probably from the PHP 5.* era. Has the server run PHP 5 previously and then been updated to PHP 7?

Last edited by gaekwad (2019-01-03 10:36:19)

Offline

#22 2019-01-03 12:32:33

singaz
Member
Registered: 2017-03-12
Posts: 71

Re: Encoding problem

Yes.

Previously, the server php5.4 (or 5.5) was run with the version txp4.5.7.

After update textpattern to 4.6.0, has been updated to php5.6.

After update textpattern to 4.7.0, has been updated to php7.


Sorry my horror English. I’m learning textpattern, I’m learning English

Offline

#23 2019-01-03 13:27:44

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,342
Website

Re: Encoding problem

Did you consider adding

AddHandler application/x-httpd-php72 .php
AddDefaultCharset utf-8

in your htaccess file? It forces the server to use php 7.2.x and UTF-8 Charsets

Last edited by colak (2019-01-03 18:19:38)


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#24 2019-01-03 18:14:10

singaz
Member
Registered: 2017-03-12
Posts: 71

Re: Encoding problem

All changes php did in the panel direct admin

My files .htaccess

# BEGIN Textpattern
#DirectoryIndex index.php index.html

 #Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default

 <IfModule mod_rewrite.c>
	RewriteEngine On
	#RewriteBase /relative/web/path/

 	RewriteCond %{HTTPS} !=on [OR]
	RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
	RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L]	

 	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -d
	RewriteRule ^(.+) - [PT,L]

 	RewriteCond %{REQUEST_URI} !=/favicon.ico
	RewriteRule ^(.*) index.php

 	RewriteCond %{HTTP:Authorization}  !^$
	RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

 ###php_value register_globals 0

 <IfModule mod_mime.c>
    AddType image/svg+xml  svg svgz
    AddEncoding gzip       svgz
</IfModule>
# END Textpattern

Perhaps, the hosting provider has made changes in inaccessible for me to view


Sorry my horror English. I’m learning textpattern, I’m learning English

Offline

#25 2019-01-03 18:18:28

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,342
Website

Re: Encoding problem

Can you try adding the two lines I posted above either before # BEGIN Textpattern or after # END Textpattern and report what happens? If you get an error of any sort, all you will need to do is delete those lines.

ps. I edited them to force php 7.2

Last edited by colak (2019-01-03 18:20:11)


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#26 2019-01-03 18:25:09

jrmartin
Member
Registered: 2013-03-07
Posts: 75

Re: Encoding problem

This could be a problem: RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC] RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L]

Offline

#27 2019-01-03 21:18:12

singaz
Member
Registered: 2017-03-12
Posts: 71

Re: Encoding problem

I made 2 experiments.

experiment 1:

deleted

RewriteCond %{HTTPS} !=on [OR]
	RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
	RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L]

and added

 AddHandler application/x-httpd-php72 .php
AddDefaultCharset utf-8

before # BEGIN Textpattern

Nothing changed.

experiment 2:

deleted

RewriteCond %{HTTPS} !=on [OR]
	RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
	RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L]	

and added

AddHandler application/x-httpd-php72 .php
AddDefaultCharset utf-8

after # END Textpattern

Nothing changed.

This is probably the specifics of hosting.

Tomorrow I will try a new installation of the new site.


Sorry my horror English. I’m learning textpattern, I’m learning English

Offline

#28 2019-01-03 22:34:12

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,553
Website

Re: Encoding problem

This bit:

RewriteCond %{HTTPS} !=on [OR]
	RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
	RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L]

is not relevant for the PHP version. It only has to do with redirecting to a secure connection and you’ll need an SSL certificate (e.g. Let’s Encrypt or a paid one) to avoid the browser trying to block access. The important thing is mydomain.com should be changed to match your own domain – maybe that is what jrmartin was referring to.

The AddHandler method is a way to force php files to handled via a specific version of php that can be different to the one set in your control panel. Setting the PHP version in the control panel or your host’s settings is preferable. You only need the AddHandler method if:

  • your host doesn’t allow you to reset your php version on a host’s site (webfaction’s specific app-container setup can make that necessary)
  • you want to change the php version for just one folder in your host’s container. For example, you have Textpattern running on php 7+ but need to use an older script in a subdirectory that is only compatible with php 5.6 (or vice versa).

You can put a phpinfo.php file into the respective directory and call it via the browser to display your php version and settings. Remember to remove it again after you’re done.

So, in summary, if all your scripts for that site run with php 7.x, set that in your control panel and you should be fine. I think gaekward’s comment is probably right: the line under open_basedir is probably just a leftover path from when the site was running an earlier version of php.


TXP Builders – finely-crafted code, design and txp

Offline

#29 2019-01-06 22:15:23

singaz
Member
Registered: 2017-03-12
Posts: 71

Re: Encoding problem

jakob thanks!

Open question for me

I will try and write off later


Sorry my horror English. I’m learning textpattern, I’m learning English

Offline

Board footer

Powered by FluxBB