PHP Warning: Unknown: failed to open stream

后端 未结 18 868
有刺的猬
有刺的猬 2020-12-02 10:54

I edited the apache httpd.conf file recently for the mod_rewrite to work. I don\'t know if this problem originated from that or not, but i\'m getting this problem from that

相关标签:
18条回答
  • 2020-12-02 11:46

    In my mind true way is:

    # add READ permission to all directories and files under your DocumentRoot
    sudo chmod +r /path/to/DocumentRoot/ -R
    
    # add EXECUTE permission to all DIRECTORIES under your DocumentRoot
    find /path/to/DocumentRoot/ -type d -exec chmod +x {} \;
    
    0 讨论(0)
  • 2020-12-02 11:49

    Experienced the same error, for me it was caused because on my Mac I have changed the DocumentRoot to my users Sites directory.

    To fix it, I ran the recursive command to ensure that the Apache service has read permissions.

    sudo chmod -R 755 ~/Sites
    
    0 讨论(0)
  • 2020-12-02 11:49

    Go to folder htdocs

    cd htdocs

    Execute

    chmod -R 755 sites

    No need to sudo !

    0 讨论(0)
  • 2020-12-02 11:52

    I had the same error and my problem was the file permissions were incorrect.

    chmod 755 index.php
    

    worked for me.

    0 讨论(0)
  • 2020-12-02 11:54

    This isn't a direct answer to the question, but I had the same problem. I installed VSFTPD on my Ubuntu Server VPS. I could upload files, but every file I uploaded didn't have execution permissions (all files had rights "600"). These posts explain explain exactly what you have to do to configure your VSFTPD to set default rights on your files:

    • Default File Permissions Apache /var/www/
    • vsFTPd default uploaded file permissions on Ubuntu not working
    0 讨论(0)
  • 2020-12-02 11:54

    Except the permissions, the problem can be open_basedir. If you are using it (and I suggest to use it) then check the settings at the VirtualHost :

     php_admin_value open_basedir <YOUR ROOT>
    
    0 讨论(0)
提交回复
热议问题