![]() |
cant create ,write with the file helper [SOLVED] - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: cant create ,write with the file helper [SOLVED] (/showthread.php?tid=30665) Pages:
1
2
|
cant create ,write with the file helper [SOLVED] - El Forum - 05-21-2010 [eluser]kosaidpo[/eluser] i can only read a text file the write function does nothin also get_filenames too btw im on ubuntu usin lampp , and yes i have the pemissions but i dont kno why icant do anythin when i do Code: if($nom=get_filenames($path)){ i got no displayed tnx fo your help ![]() cant create ,write with the file helper [SOLVED] - El Forum - 05-21-2010 [eluser]vitoco[/eluser] is path correct ??, try to do this Code: echo 'REALPATH:[['.realpath($path).']]'; i got no displayed tnx fo your help ![]() cant create ,write with the file helper [SOLVED] - El Forum - 05-22-2010 [eluser]kosaidpo[/eluser] tnx dude now ican only read but i cant create files with write_file and your code gave me a yes does exist cant create ,write with the file helper [SOLVED] - El Forum - 05-22-2010 [eluser]WanWizard[/eluser] Note that in the code of vitoco, the true and false is reversed due to the "! is_dir()" test. So if it says "DIR EXISTS", it means the path is NOT correct! cant create ,write with the file helper [SOLVED] - El Forum - 05-22-2010 [eluser]kosaidpo[/eluser] hii tnx for replyin yeh i didnt notice it but well i got the application folder out of the system and and this is my function ican read but cant write (even im pretty sure that im the owner of this hole folder htdocs) Code: function write(){ tnx for help cant create ,write with the file helper [SOLVED] - El Forum - 05-22-2010 [eluser]WanWizard[/eluser] What does Code: $path="application/controllers/file.txt" ; You have to be very careful when working with relative paths. It is better to use Code: $path = APPPATH . "controllers/file.txt"; cant create ,write with the file helper [SOLVED] - El Forum - 05-22-2010 [eluser]kosaidpo[/eluser] the realpath give me the hole path /opt/lampp/htdocs/www/CI_forum/application/controllers/file.txt but to be honest idont kno wht does it refer to but the APPPATH refers to the application folder correct me please/tnx and still cant write ![]() cant create ,write with the file helper [SOLVED] - El Forum - 05-22-2010 [eluser]WanWizard[/eluser] APPPATH points to the application directory, correct. If you use it you don't have possible relative path issues. If you are sure the path is correct, it must be a rights issue. Check every directory, starting from the root, to make sure your apache user has X rights on every directory, and XW rights on '/opt/lampp/htdocs/www/CI_forum/application/controllers/'. cant create ,write with the file helper [SOLVED] - El Forum - 05-22-2010 [eluser]kosaidpo[/eluser] yeh thats the only thing i guess but you got to see this Code: xsaiddx@xsaiddx-laptop:~$ ls -ld /opt/lampp/htdocs/www/CI_forum/application/controllers/ you advice me to check sumthin else other than that tnx cant create ,write with the file helper [SOLVED] - El Forum - 05-22-2010 [eluser]WanWizard[/eluser] Who or wat is xsaiddx? Because that is the only user with write rights in that folder. So that solves the mistery, as mentioned way up in this thread, your apache user doesn't have write rights. |