遇到一个php session的问题,游戏页面进不去,报错

PHP Warning: Unknown: Your script possibly relies on a session side-effect
  which existed until PHP 4.2.3. Please be advised that the session extension does
  not consider global variables as a source of data, unless register_globals is enabled.
  You can disable this functionality and this warning by setting session.bug_compat_42
  or session.bug_compat_warn to off, respectively. in Unknown on

搜索文档,是需要将php配置文件中的这两项关闭

session.bug_compat_42=0
session.bug_compat_warn=0

使用phpinfo来查看php.ini的路径,路径是/usr/local/php/lib

php.ini文件找不到_php.ini

命令中查找

[root@localhost ~]# php -i | grep Configuration

Configuration File (php.ini) Path => /usr/local/lib

Loaded Configuration File => (none)

Configuration

在安装路径/usr/local/php/etc和/etc/下查找都没有php.ini这个文件


使用命令locate来全盘查找

php.ini文件找不到_php.ini_02

在home下有个php.ini-dist ,把php.ini-dist命令为php.ini

并重启php-fpm

/usr/local/php/sbin/php-fpm restart

在查看phpinfo

php.ini文件找不到_文件找不到_03

有了,然后修改php.ini的配置文件,并重启,可以了