fwrite 's paragram filename cause error Permission deniedHow can I handle the warning of file_get_contents() function in PHP?file_put_contents permission deniedmove_uploaded_file gives “failed to open stream: Permission denied ” error after all configurations I didPermission denied when opening or creating files with PHPPHP - fopen(error.log): failed to open stream: Permission denied inReference - What does this error mean in PHP?Having An Issue Backing Up MY Database From PhpPermission denied error in php when try to write in a txt filefile_put_contents(meta/services.json): failed to open stream: Permission deniedPHP function.fopen failed to open stream: Permission denied

Get list of shortcodes from content

Has a life raft ever been successfully deployed on a modern commercial flight?

Why do all the teams that I have worked with always finish a sprint without completion of all the stories?

Excluding a rectangular region from an image in FITS

What happened to Steve's Shield in Iron Man 2?

`-` in tar xzf -

Hit the Bulls Eye with T in the Center

Should the party get XP for a monster they never attacked?

Encounter design and XP thresholds

How to make clear to people I don't want to answer their "Where are you from?" question?

Is declining an undergraduate award which causes me discomfort appropriate?

career in signal processing

Why is "Congress shall have power to enforce this article by appropriate legislation" necessary?

Why does independence imply zero correlation?

Is there any difference between Т34ВМ1 and КМ1858ВМ1/3?

How does DC work with natural 20?

Should I include an appendix for inessential, yet related worldbuilding to my story?

"Permanent resident of UK” for a British travel insurance in the US

Android Material and appcompat Manifest merger failed in react-native or ExpoKit

UK - Working without a contract. I resign and guy wants to sue me

Is there any proof that high saturation and contrast makes a picture more appealing in social media?

Are all Ringwraiths called Nazgûl in LotR?

Trainee keeps passing deadlines for independent learning

Story about a space war, and a human prisoner of war captured by alien enemy



fwrite 's paragram filename cause error Permission denied


How can I handle the warning of file_get_contents() function in PHP?file_put_contents permission deniedmove_uploaded_file gives “failed to open stream: Permission denied ” error after all configurations I didPermission denied when opening or creating files with PHPPHP - fopen(error.log): failed to open stream: Permission denied inReference - What does this error mean in PHP?Having An Issue Backing Up MY Database From PhpPermission denied error in php when try to write in a txt filefile_put_contents(meta/services.json): failed to open stream: Permission deniedPHP function.fopen failed to open stream: Permission denied






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















my code:



$ffff = fopen("quce/1459412934LxKWY.", 'w');
fwrite($ffff, 'test');
fclose($ffff);


and the build result:




PHP Warning: fopen(quce/1459412934LxKWY.): failed to open stream:
Permission denied











share|improve this question
























  • You just have to give permisions to that file (chmod). Or folder if thats the problem.

    – Elanochecer
    Mar 25 at 7:37












  • I have tried, but the same it run. I think its caused by hte paragram filename, i run on Windows.

    – VIKI
    Mar 25 at 8:11











  • Why are you trying to create a file with a name that ends with a dot in the first place? (If you tried that in Windows Explorer, it would just remove this trailing dot anyway.)

    – 04FS
    Mar 25 at 8:23


















0















my code:



$ffff = fopen("quce/1459412934LxKWY.", 'w');
fwrite($ffff, 'test');
fclose($ffff);


and the build result:




PHP Warning: fopen(quce/1459412934LxKWY.): failed to open stream:
Permission denied











share|improve this question
























  • You just have to give permisions to that file (chmod). Or folder if thats the problem.

    – Elanochecer
    Mar 25 at 7:37












  • I have tried, but the same it run. I think its caused by hte paragram filename, i run on Windows.

    – VIKI
    Mar 25 at 8:11











  • Why are you trying to create a file with a name that ends with a dot in the first place? (If you tried that in Windows Explorer, it would just remove this trailing dot anyway.)

    – 04FS
    Mar 25 at 8:23














0












0








0








my code:



$ffff = fopen("quce/1459412934LxKWY.", 'w');
fwrite($ffff, 'test');
fclose($ffff);


and the build result:




PHP Warning: fopen(quce/1459412934LxKWY.): failed to open stream:
Permission denied











share|improve this question
















my code:



$ffff = fopen("quce/1459412934LxKWY.", 'w');
fwrite($ffff, 'test');
fclose($ffff);


and the build result:




PHP Warning: fopen(quce/1459412934LxKWY.): failed to open stream:
Permission denied








php file-io






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 7:40









Nigel Ren

31.4k62036




31.4k62036










asked Mar 25 at 7:36









VIKIVIKI

11




11












  • You just have to give permisions to that file (chmod). Or folder if thats the problem.

    – Elanochecer
    Mar 25 at 7:37












  • I have tried, but the same it run. I think its caused by hte paragram filename, i run on Windows.

    – VIKI
    Mar 25 at 8:11











  • Why are you trying to create a file with a name that ends with a dot in the first place? (If you tried that in Windows Explorer, it would just remove this trailing dot anyway.)

    – 04FS
    Mar 25 at 8:23


















  • You just have to give permisions to that file (chmod). Or folder if thats the problem.

    – Elanochecer
    Mar 25 at 7:37












  • I have tried, but the same it run. I think its caused by hte paragram filename, i run on Windows.

    – VIKI
    Mar 25 at 8:11











  • Why are you trying to create a file with a name that ends with a dot in the first place? (If you tried that in Windows Explorer, it would just remove this trailing dot anyway.)

    – 04FS
    Mar 25 at 8:23

















You just have to give permisions to that file (chmod). Or folder if thats the problem.

– Elanochecer
Mar 25 at 7:37






You just have to give permisions to that file (chmod). Or folder if thats the problem.

– Elanochecer
Mar 25 at 7:37














I have tried, but the same it run. I think its caused by hte paragram filename, i run on Windows.

– VIKI
Mar 25 at 8:11





I have tried, but the same it run. I think its caused by hte paragram filename, i run on Windows.

– VIKI
Mar 25 at 8:11













Why are you trying to create a file with a name that ends with a dot in the first place? (If you tried that in Windows Explorer, it would just remove this trailing dot anyway.)

– 04FS
Mar 25 at 8:23






Why are you trying to create a file with a name that ends with a dot in the first place? (If you tried that in Windows Explorer, it would just remove this trailing dot anyway.)

– 04FS
Mar 25 at 8:23













1 Answer
1






active

oldest

votes


















0














This issue can also be a result of having SELinux enabled. This can be solved using:



chown -R apache:apache /var/www/html/directory_to_write
chcon -R -t httpd_sys_content_t /var/www/html/directory_to_write
chcon -R -t httpd_sys_rw_content_t /var/www/html/directory_to_write


You can find more about the contexts at https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-The_Apache_HTTP_Server-Types.html






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55333104%2ffwrite-s-paragram-filename-cause-error-permission-denied%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    This issue can also be a result of having SELinux enabled. This can be solved using:



    chown -R apache:apache /var/www/html/directory_to_write
    chcon -R -t httpd_sys_content_t /var/www/html/directory_to_write
    chcon -R -t httpd_sys_rw_content_t /var/www/html/directory_to_write


    You can find more about the contexts at https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-The_Apache_HTTP_Server-Types.html






    share|improve this answer



























      0














      This issue can also be a result of having SELinux enabled. This can be solved using:



      chown -R apache:apache /var/www/html/directory_to_write
      chcon -R -t httpd_sys_content_t /var/www/html/directory_to_write
      chcon -R -t httpd_sys_rw_content_t /var/www/html/directory_to_write


      You can find more about the contexts at https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-The_Apache_HTTP_Server-Types.html






      share|improve this answer

























        0












        0








        0







        This issue can also be a result of having SELinux enabled. This can be solved using:



        chown -R apache:apache /var/www/html/directory_to_write
        chcon -R -t httpd_sys_content_t /var/www/html/directory_to_write
        chcon -R -t httpd_sys_rw_content_t /var/www/html/directory_to_write


        You can find more about the contexts at https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-The_Apache_HTTP_Server-Types.html






        share|improve this answer













        This issue can also be a result of having SELinux enabled. This can be solved using:



        chown -R apache:apache /var/www/html/directory_to_write
        chcon -R -t httpd_sys_content_t /var/www/html/directory_to_write
        chcon -R -t httpd_sys_rw_content_t /var/www/html/directory_to_write


        You can find more about the contexts at https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-The_Apache_HTTP_Server-Types.html







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 7:47









        kartik radadiyakartik radadiya

        1347




        1347





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55333104%2ffwrite-s-paragram-filename-cause-error-permission-denied%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript