Page 1 of 1

migrate to different php version

Posted: Fri Feb 08, 2019 12:34 pm
by grace2017
Hi, I added a php visit counter to my web application in centos 7 and thi's ok. Now I had been migrate it at another server and I couldn't see the count visiter:

The PHP version, in the original server centos 7 is:
  • Arch: x86_64
  • Version: 5.4.16
  • Release: 46.el7
  • Repo: base/7/x86_64
The PHP version, in the new server centos 7 is:
  • Arch: x86_64
  • Version: 7.1.26
  • Release: 1.el7.remi
  • Repo: installed
  • From repo: remi-php71
Please will you give me a tip?

Thanks a lot. Regards.

Re: migrate to different php version

Posted: Fri Feb 08, 2019 1:09 pm
by grace2017
Sorry I forgot tell you that I reviewed the web log apache and I found:

[php7:warn] [pid 24874] PHP Warning: fclose() expects parameter 1 to be resource, boolean given in ...

I read that it's caused by SELinux but I don't very sure, I will thankful for you hepl.

The counter's file permissions: counter.txt are
counter.txt 775 apache:apache

Regards.

Re: migrate to different php version

Posted: Sat Feb 09, 2019 2:36 am
by hyper
The bit after:
PHP Warning: fclose() expects parameter 1 to be resource, boolean given in
will give you the file name and line number to look at:

fclose ( resource $handle ) you have not given a file handle (the one created using fopen)

Whenever you get an error, read it; as it gives you where to look for the problem.

Wherever you read that it was an operating system is completely wrong and the file permissions have nothing to do with it either - incidentally, they should be set to 664, as you do not execute php files from the file system directly.