PHP cannot write to text file

前端 未结 1 1601
逝去的感伤
逝去的感伤 2021-01-29 15:16

I have the following code which I am using in WordPress/Woocommerce:

function generatePassword($length = 6) {
$characters = \'0123456789abcdefghijklmnopqrstuvwxy         


        
1条回答
  •  孤独总比滥情好
    2021-01-29 15:45

    You have to provide Web server path of actual file location path in your server instead of url.

    $test = 'http://advokatami.bg/ot/a/docs/test/test.txt';
    

    Replace it by Server path

    $test = '/ot/a/docs/test/test.txt';
    

    Make sure test have permission for read and write publicly.

    How can you check your folder path?

    1) Make test.php file in ot folder with below code

    2) Upload it in ot folder.

    3) execute file from browser http://advokatami.bg/ot/test.php

    4) Copy path before \ot\.... and replace it on .

    0 讨论(0)
提交回复
热议问题