Fopen problem

Discussion in 'PHP' started by awesomehosting, Mar 15, 2007.

  1. #1
    Hi

    I am getting the following error:

    Warning: fopen(../*****) [function.fopen]: failed to open stream: Permission denied in /var/home/****** on line 5
    Cannot open file ()

    I am running PHP4 on a linux server...

    any ideas on what I can do to fix it ?

    Thanx
     
    awesomehosting, Mar 15, 2007 IP
  2. rays

    rays Active Member

    Messages:
    563
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    check file permissions of a source file (Which one you are using).

    Php uses same user as that of apache , so make sure you grant all permissions to a file so that apache can read it.

    use CHMOD command to do it ....

    Permission 777 is a global permission. similar details you can get from manual pages of chmod
     
    rays, Mar 15, 2007 IP
  3. jitesh

    jitesh Peon

    Messages:
    81
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Write a php function

    chmod('/dir/path','0777')

    before fopen.
     
    jitesh, Mar 15, 2007 IP
  4. awesomehosting

    awesomehosting Banned

    Messages:
    409
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    130
    #4
    Hi

    Thanx for the help worked like a bomb...
     
    awesomehosting, Mar 15, 2007 IP
  5. kobra

    kobra Member

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    the Temp directory where you store you session files doesn't have the permissions
     
    kobra, Mar 16, 2007 IP