Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6142547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:24:07+00:00 2026-05-23T18:24:07+00:00

I have this simple code: <?php $myFile =’test.txt’; $myContent =’Some text’; file_put_contents($myFile, utf8_encode($myContent)); ?>

  • 0

I have this simple code:

<?php
$myFile ='test.txt';
$myContent ='Some text';
file_put_contents($myFile, utf8_encode($myContent));
?>

the location of the test.txt file is here:

/srv/www/htdocs/didebansnort

the page that I wrote this php code in browser:

http://localhost/didebansnort/testdl.php

the code is not working it will not write the string on it

RESULT:in properties it wasn’t sufficient to set the permissions

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:24:08+00:00Added an answer on May 23, 2026 at 6:24 pm

    Make sure that the user PHP/Apache runs as has write permissions to that file.

    In Linux, you can give read (r), write (w) and execute (x) rights either to yourself, your group(s) or everyone else. Make sure you either give write permissions to a group that has both you and the PHP user as members, or give write access to everyone (not to be used in production).

    You’re stating you use OpenSuse, you can find more details about permissions here:

    • 7.3 File Access Permissions
    • 8.5 Modifying File Permissions
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this simple code in php: <?php header(Content-type: application/vnd.ms-word); header(Content-Disposition: attachment;Filename=kid_tag.doc); echo '<table
Hi We have some php code using the file_get_contents() function, and I understand this
There is probably is simple fix for this but I currently have code similar
I have this simple php script <?php echo '<pre>'; // Outputs all the result
I have this very simple python code to read xml for the wikipedia api:
I don't code in PHP, but I have this form which I pulled off
I have a simple php structures. class Ingredient and class Ingredients, i have this
i have used this code in my index.php to get user facebook first name
I have a this aspx-code: (sample) <asp:DropDownList runat=server ID=ddList1></asp:DropDownList> With this codebehind: List<System.Web.UI.WebControls.ListItem> colors
I have this simple regex, [\d]{1,5} that matches any integer between 0 and 99999.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.