migrate to different php version

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
grace2017
New php-forum User
New php-forum User
Posts: 11
Joined: Tue Oct 31, 2017 9:14 am

Fri Feb 08, 2019 12:34 pm

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.

grace2017
New php-forum User
New php-forum User
Posts: 11
Joined: Tue Oct 31, 2017 9:14 am

Fri Feb 08, 2019 1:09 pm

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.

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 839
Joined: Mon Feb 22, 2016 5:52 pm

Sat Feb 09, 2019 2:36 am

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.

Post Reply