当前位置 : 主页 > 网络编程 > PHP >

php 5.6

来源:互联网 收集:自由互联 发布时间:2023-12-16
返回值(语法) Nginx、php5.6+ 中 打开⽹网站⾸首⻚页,显示: A PHP Error was encounteredSeverity: NoticeMessage: Only variable references should be returned by referenceFilename: core/Common.phpLine Number: 257 解决⽅方法

返回值(语法)

Nginx、php5.6+ 中 打开⽹网站⾸首⻚页,显示:

A PHP Error was encountered
Severity: Notice
Message: Only variable references should be returned by reference
Filename: core/Common.php
Line Number: 257

解决⽅方法:打开 system/core/Common.php

// 将
return $_config[0] =& $config;
// 修改为
$_config[0] =& $config; return $_config[0];

修改php.ini

打开 /private/etc/ ⽬目录

如果没有 php.ini ,则根据 php.ini.default 创建⼀一个

sudo cp /private/etc/php.ini.default /private/etc/php.ini

修改为:

# 注释去掉,重启php-fpm session_path='/tmp'
# 在php7中只有这个 session.save_path = "/tmp"

MySQL驱动错误

出现如下问题:(php.ini配置导致)

A PHP Error was encountered
Severity: Warning
Message: mysqli::real_connect(): (HY000/2002): No such file or directory
Filename: mysqli/mysqli_driver.php

网友:默认以下配置为空:

# 将以下三个选项设置成你mysql.sock对应的⽬目录就可以解决了了 mysql.default_socket = /tmp/mysql.sock pdo_mysql.default_socket= /tmp/mysql.sock mysqli.default_socket =/tmp/mysql.sock
网友评论