seco Posted January 13, 2008 Share Posted January 13, 2008 Hi i test my page that is put the file content on local server and it works file and when i uplaod it to the server it gives me this error:- Warning: file_put_contents("myfile.xml") [function.file-put-contents]: failed to open stream: Permission denied in .... line .. any help? thanks in advance. Quote Link to comment Share on other sites More sharing options...
Hypnos Posted January 13, 2008 Share Posted January 13, 2008 Make sure the permissions on the file are correct. They should be at least 644, being owned by the apache (or suexec) user. Quote Link to comment Share on other sites More sharing options...
seco Posted January 13, 2008 Author Share Posted January 13, 2008 i make it 775 and still gives te same warning !! Quote Link to comment Share on other sites More sharing options...
seco Posted January 13, 2008 Author Share Posted January 13, 2008 any alternative function to write the output to a file other than put content? or is there a solution? Quote Link to comment Share on other sites More sharing options...
seco Posted January 13, 2008 Author Share Posted January 13, 2008 the function already working on localserver perfect (im using wamp) Quote Link to comment Share on other sites More sharing options...
tinker Posted January 13, 2008 Share Posted January 13, 2008 You might get more information about why it's happening by using fopen, if you read the manual for file_put_contents then you will see the tip that say's to use an url you need the support enabled in php.ini (which could possibly be a xss liability, so webmasters can disable). Maybe seeing the actual code your using might help. Quote Link to comment Share on other sites More sharing options...
seco Posted January 13, 2008 Author Share Posted January 13, 2008 i just have a content and i want to write it to a file by any means how? the content is just a text i generated no urls open Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.