





In a fresh CENTOS, while installing & testing nginx i’v faced the following error..
2019/10/10 17:54:11 [crit] 18960#0: *1 stat() "/home/www/html/index.php" failed (13: Permission denied), client: 94.61.69.69, server: 51.158.69.69, request: "GET /index.php HTTP/1.1", host: "51.158.69.69"
This is how I’v solved.
chcon -R -t httpd_sys_content_t /home/www/html/

A CI application was returning me the following error, after the PHP been updated to 7.3.
I had to change a few lines at config/config.php
function __autoload($class)
{
if(strpos($class, 'CI_') !== 0)
{
@include_once( APPPATH . 'core/'. $class . EXT );
}
}
to
spl_autoload_register(function($class) {
@include_once ( APPPATH . 'core/'. $class . EXT );
});
$some_variable_on_include_php = '12'; ob_start(); include 'include.php'; $buffer = ob_get_clean();
If you are using mail() to send an email, with PHP, and you are getting the following error…
spf=neutral (google.com: 69.55.XXX.XXX is neither permitted nor denied by best guess record for domain of [email protected]) [email protected] Return-Path: <[email protected]>
You can force the ‘mailfrom’ by adding -f[email protected], after the headers.
$send = mail($to, $subject, $message, implode("\r\n", $headers), '-f'.$from);
If we need to toggle on a value, (for 1 to 0 and vice-versa for example), using a update, this is one solution…
UPDATE user SET profile_status = CASE WHEN profile_status = 1 THEN 0 ELSE 1 END WHERE user_id="1";