EllisLab text mark
Advanced Search
     
Strange error on codeigniters LOG
Posted: 14 March 2008 07:52 AM   [ Ignore ]
Joined: 2006-01-23
15 posts

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:

DEBUG 2008-03-14 06:17:21 --> ---Matchbox---
ERROR 2008-03-14 06:17:21 --> SeverityWarning  --> 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

@chmod($filepath0666); 

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

 
Posted: 14 March 2008 03:25 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2007-04-26
2 posts

I would check to see if safe mode is on. I am pretty sure you can not chmod if it is.

Tim

 
Posted: 15 March 2008 01:40 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2006-01-23
15 posts

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.

 
Posted: 22 March 2008 04:48 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2007-11-11
17 posts

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.

 Signature 

I may disagree with what you say, but I will defend to the death your right to misattribute this quote to Voltaire

 
Posted: 22 March 2008 05:02 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2007-11-11
17 posts

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.

 Signature 

I may disagree with what you say, but I will defend to the death your right to misattribute this quote to Voltaire

 
Posted: 23 March 2008 04:10 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Joined: 2006-01-23
15 posts

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.

 
Posted: 26 March 2008 04:50 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Joined: 2007-11-11
17 posts

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.

 Signature 

I may disagree with what you say, but I will defend to the death your right to misattribute this quote to Voltaire

 
Posted: 16 June 2008 02:33 AM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Joined: 2007-03-22
1 posts

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/

 
Posted: 26 August 2010 04:00 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Joined: 2010-08-26
1 posts

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