Welcome Guest, Not a member yet? Register   Sign In
Strange error on codeigniters LOG
#1

[eluser]miguelp[/eluser]
I'm developing a cms system for a client, and i think that it would be usefull to write it using modules (matchbox), I'm running the latest version of code igniter 1.6.1 on a Linux server using Apache 2.0 and PHP Version 4.3.10-18 (client's server) and i was looking at the logs file to see if there's any erros, and i found this one:

Code:
DEBUG - 2008-03-14 06:17:21 --> ---Matchbox---
ERROR - 2008-03-14 06:17:21 --&gt; Severity: Warning  --&gt; chmod() [<a href='function.chmod'>function.chmod</a>]: Operation not permitted /var/www/askmelisboa/system/libraries/Log.php 112
there is a lot of them on the file so i guess this error gets fired up every time the library log.php is called.
i checked what the file does on that line, and the line is part of the function "write_log" and after it write the file try's to change the file permitions to 0666
Code:
@chmod($filepath, 0666);

the logs folder is set to 0777 so it can be written, so what's causing this error?
and how to fix it?
It dosen't have anything to do with matchbox it self it happens with other files, basically every time the log.php get's called, but anyway hope you can help me out to find a solution.

Thanks in advance
miguelp
#2

[eluser]Unknown[/eluser]
I would check to see if safe mode is on. I am pretty sure you can not chmod if it is.

Tim
#3

[eluser]miguelp[/eluser]
Hey thanks for your fast reply, but i've checked that and safe_mode is OFF. So it cant be the origin of the problem.
#4

[eluser]happs74[/eluser]
Hi Miguelp,

Did you ever get to the bottom of this, I'm having the same problem and can't see what the problem could be.
#5

[eluser]happs74[/eluser]
I swear to god, i need to write a app that is like a forum that I could write posts to, it wouldn't actually do anything with my posts but 60 seconds later the answer to the problem I was posting about would suddenly appear in my head.

I'd copied my app from my dev setup to my live server and copied the log file along with it, I'm guessing there was some crazy permission shit going on (despite giving it the 7's) cos when I deleted it and allowed CI to create it these messages disappeared. I'll leave it to the more knowledgeable among you to point out the reasons why but that's how I fixed it.
#6

[eluser]miguelp[/eluser]
Well, i erased the logs on the prudoction server, and made a review on all file permitions, then turn the logs on again, and i have the same error, i've tryed so far:

- windows XP + Apache 2.2 + php 5.2 (mod_php5)
- windows Vista + Apache 2.2 + php 5.2 (mod_php5)
- windows XP + IIS 6 + php 5.2 (fast_cgi)
- windows Vista + IIS 6 + php 5.2 (fast_cgi)
- fedora core 7 + Apache 2.2 + php 5.2 (mod_php5)
- ubuntu 7.10 + Apache 2.2 + php 5.2 (mod_php5)
- Red Hat Enterprise Linux 5 + Apache 2.2 + php 5.2 (mod_php5)

So far all with the same problem, i cant make sense of it.
#7

[eluser]happs74[/eluser]
Sorry dude, I'm a linux, php & CI noob, so I doubt I can give you a definitive answer. The only thing I'd suggest is retrace your steps, make sure you can log from a basic CI install and start adding in bits from your project until it breaks and take it from there.
#8

[eluser]Unknown[/eluser]
I had this same error, but resolved it by not only setting the permissions to 777 but by also setting the user and group to whatever user/group the webserver is running as.

chmod -R 0777 logs/
chown -R www:www logs/
#9

[eluser]Unknown[/eluser]
I had similar issue, but it was the selinux. If you're running selinux in enforcing mode, and you have move CodeIgniter somewhere outside of your web-root (like /usr/shared/php), this this should fix the issue.

chcon -R user_u:object_r:httpd_sys_content_t /where/ever/you/installed/ci/logs




Theme © iAndrew 2016 - Forum software by © MyBB