PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, January 12, 2022

[FIXED] Can't write logs in linux using Yii::log?

 January 12, 2022     linux, php, rhel, yii     No comments   

Issue

in Yii based web application i am writing log files using

Yii::log('info', CLogger::INFO, $exception);

It is perfectly working in Windows. But when i try this in RHEL 6.0 it is not writing and not showing any error response

I have changed the directory permissions as well

chmod 777 /var/www/html/yiiblog/protected/runtime

but it s not working and not showing any thing in error log of apache

What is the reason for this and how to fix this ?


Solution

Your chmod command is wrong. Try this one instead and take a look at the documentation.

chmod 0777 /var/www/html/yiiblog/protected/runtime

Exactly, this is the difference between 777/0777.

0777 (octal) == binary 0b 111 111 111 == permissions rwxrwxrwx (== decimal 511)
777 (decimal) == binary 0b 1 100 001 001 == permissions sr----x--x (== octal 1411)


Answered By - lin
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing